°ïæ¸ÄÒ»¸öC³ÌÐò£¬Ð»Ð» - C/C++ / CÓïÑÔ
C/C++ code:
#include <stdio.h>
#include <string.h>
struct s1
{
char a[10];
};
struct s2
{
char b[10];
};
int main()
{
struct s1 *ps1;
struct s2 *ps2;
ps1->a ="wanggl";
strcpy(ps2->b,ps1->a);
printf("%s\n",ps2->b);
getchar();
return 0;
}
1>c:\documents and settings\administrator\×ÀÃæ\c51\te\te.cpp(16) : error C2440: ¡°=¡±: ÎÞ·¨´Ó¡°const char [7]¡±×ª»»Îª¡°char [10]¡±
int main()
{
struct s1 ps1;
struct s2 ps2;
strcpy(ps1.a ,"wanggl");
strcpy(ps2.b,ps1.a);
printf("%s\n",ps2.b);
getchar();
return 0;
}
C/C++ code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct s1
{
char a[10];
};
struct s2
{
char b[10];
};
int main()
{
struct s1 *ps1;
struct s2 *ps2;
ps1 = (struct s1 *)malloc(sizeof(struct s1));
ps2 = (struct s2 *)malloc(sizeof(struct s2));
ps1->a ="wanggl";
strcpy(ps2->b,ps1->a);
printf("%s\n",ps2->b);
getchar();
return 0;
}
ÉÏÃæ¾¹È»Ã»·ÖÅäÄÚ
Ïà¹ØÎÊ´ð£º
ÓÐÒ»10*10¾ØÕ󣬳ýÈ¥µÚÒ»¸öµã£¨0£¬0£©ºÍ×îºóÒ»µã£¨9£¬9£©£¬»¹Óа˸öµãΪ1£¬ÆäËû¶¼Îª0£¬ÒªÇóÓöþάÊý×é±íʾ¡£°Ë¸öµãÊÇËæ»úÉú³ÉµÄ£¬±àдÏà¹Ø³ÌÐò±íʾ¾ØÕóËùÓпÉÄÜÇé¿ö¡£
ÕæÐÄÇó½Ì¸÷λ¸ßÊÖ£¬°¥£¡±¾ÈËÌ«²ËÁË£¡ºÇºÇ£¡
......
´ó¼ÒºÃ£º
ÎÒÏëʵÏÖ¼ì²âµ½²åÈëSD¿¨ºó×Ô¶¯½«SD¿¨¸ñʽ»¯µÄ¹¦ÄÜ£¬²»ÖªC/C++ÖÐÓÐûÓиñʽ»¯UÅ̵ĺ¯Êý£¿
ÁíÍ⣬ÎÒ²»ÏëʹÓÃSHFormatDrive£¬ÒòΪÕâ¸öº¯Êý»áµ¯³öÊÇ·ñÒª¸ñʽ»¯µÄÌáʾ¿ò£¬ÎÒÐèÒªµÄÊÇϵͳ×Ô¶¯¸ñʽ»¯£¬¶ø²Ù×÷Õß² ......
ËÄܰïÎÒ°ÑÏÂÃæÕâЩ´úÂë¸Ä³ÉVBÐÎʽµÄ£¬¶àлÁË£¬¼±ÓÃ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[],float g ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆÌ¨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆÌ¨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆÌ¨£ ......
[align=center][/align]CÓïÑÔÖÐÈçºÎÅжÏÒ»¸ödoubleÐ͵ÄÊý×飨Èçdouble S[20]£»£©ÊÇÒ»¸ö¿ÕÊý×飬¼´Êý×éÖÐûÓзÅÈκÎÖµ¡£
û°ì·¨¡£
"ÈκÎÖµ" µÄ¶¨Òå?
¾ÍÊÇÊý×éÊǿյģ¬Ã»ÓÐΪËü¸³Öµ
¿ÉÒÔ¿¼Â ......