°ïæ¸ÄÒ»¸ö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;
}
ÉÏÃæ¾¹È»Ã»·ÖÅäÄÚ
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
´ó¼ÒºÃ£º
ÎÒÏëʵÏÖ¼ì²âµ½²åÈëSD¿¨ºó×Ô¶¯½«SD¿¨¸ñʽ»¯µÄ¹¦ÄÜ£¬²»ÖªC/C++ÖÐÓÐûÓиñʽ»¯UÅ̵ĺ¯Êý£¿
ÁíÍ⣬ÎÒ²»ÏëʹÓÃSHFormatDrive£¬ÒòΪÕâ¸öº¯Êý»áµ¯³öÊÇ·ñÒª¸ñʽ»¯µÄÌáʾ¿ò£¬ÎÒÐèÒªµÄÊÇϵͳ×Ô¶¯¸ñʽ»¯£¬¶ø²Ù×÷Õß² ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎͼ¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆÌ¨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆÌ¨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆÌ¨£ ......
A±í ÓÐÁ½¸ö×Ö¶Î
id ΨһÊý×ÖÓò
InfoTxt text ÀàÐÍ
ÎÒÏÖÔÚÒª°Ñ id ²»ÊÇ14 µÄËùÓÐ InfoTxt×Ö¶Î Îı¾ºóÃæ ¶¼¼ÓÉÏ 'aaa'
°´ÏÂÃæÖ´ÐÐÏÂÀ´ Ö»Óбí×îºóÒ»ÐмÓÉÏÁË 'aaa' ......