Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¶ÔC²»ÊìϤ`¸÷λ°ï°ïæ`ÌâÄ¿Çó½â - C/C++ / CÓïÑÔ

×îºÃÓÐ×¢Ê͹þ
лÁË`


£¨1£©£ºÕÒ³öÏÂÃæÕâÁ½¶Î³ÌÐòÖеĴíÎó£º
void test1()
{
¡¡char string[10];
¡¡char* str1 = "0123456789";
¡¡strcpy( string, str1 );
}


test2( int* p1,int* p2 )
{
¡¡int *p;
¡¡*p = *p1;
¡¡*p1 = *p2;
¡¡*p2 = *p;
}¡¡¡¡


£¨2£©£º£º±àдһ¸öÓÃÓÚ×Ö·û´®¸´ÖƵĺ¯Êý(strcpy)


}
£¨3£©£º£º·Ö±ð¸ø³öBOOL£¬int£¬floatÓë¡°ÁãÖµ¡±±È½ÏµÄ if Óï¾ä£¨¼ÙÉè±äÁ¿ÃûΪvar£©

¡¡


£¨1£©£ºÕÒ³öÏÂÃæÕâÁ½¶Î³ÌÐòÖеĴíÎó£º
void test1()
{
¡¡char string[10];
¡¡char* str1 = "0123456789"; //ÕâÀïµÄ×Ö·û×ÜÊýΪ10+1(½áÊø·û'\0')=11
¡¡strcpy( string, str1 ); //Òò´ËÕâÀ�±´µÄʱºò£¬str1µÄ³¤¶È´óÓÚstring, µ¼ÖÂstringÔ½½ç.
}


void test2( int* p1,int* p2 ) //ÎÞ·µ»ØÖµÀàÐÍ
{
¡¡int *p;
¡¡*p = *p1;
¡¡*p1 = *p2;
¡¡*p2 = *p;
}¡¡¡¡

£¨2£©£º£º±àдһ¸öÓÃÓÚ×Ö·û´®¸´ÖƵĺ¯Êý(strcpy)
/* copyº¯Êý£º ½«from¸´ÖƵ½to; ÕâÀï¼Ù¶¨to ×ã¹»´ó */
void copy(char to[], char from[])
{
  int i = 0;
  while ((to[i] = from[i]) != '\0')
  ++i;
}

£¨3£©£º£º·Ö±ð¸ø³öBOOL£¬int£¬floatÓë¡°ÁãÖµ¡±±È½ÏµÄ if Óï¾ä£¨¼ÙÉè±äÁ¿ÃûΪvar£©
BOOL: ÁãÖµ¼´Îªfalse£¬È¡·´¾Í¿ÉÒÔÁË
if(!var) {
   
}

int:Óë0±È½Ï¾ÍÐÐÁË
int(var==0) {

}

float: ¸¡µãÊý´æÔÚÒ»¶¨µÄ¾«¶ÈÎó²î£¬È¡¾«¶È


Ïà¹ØÎÊ´ð£º

linux»·¾³ÏÂgethostbynameº¯ÊýÎÊÌâ - C/C++ / CÓïÑÔ

дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

VFPÈçºÎµ÷ÓÃCº¯Êý - ÆäËûÊý¾Ý¿â¿ª·¢ / VFP

ÇëÎÊVFPÖÐÈçºÎµ÷ÓÃC/C++º¯Êý£¿

ÄãÒªµ÷ÓÃʲô¹¦Äܵĺ¯Êý£¿Òª¿´¿´VFPÖÐÓÐûÓжÔÓ¦µÄº¯Êý£¬Èç¹ûÓоÍÊ¡×ÅÔÙµ÷ÓÃÁË¡£Èç¹ûûÓУ¬¿ÉÒÔ½«C/C++º¯Êýд¸öDLL»òFLL£¬È»ºóÔÚVFPµ÷Óü´¿É¡£

Ê®¶¹Èý ÀÏʦ£¬Ôõô²ÅÄÜÐÞ¸Ä×Ô¼ºµÄ ......

Ϊʲôxml²»ÄÜÏÔʾ°¢À­²®ÎÄ - C/C++ / C++ ÓïÑÔ

ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À­²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À­²®ÎĵÄ×Ö¿âÄãÓÐô£¿

ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ