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

c ×Ö·û´®´¦Àí

³ÌÐò¿ªÍ·ÒªÉùÃ÷
#include <string.h>
 
º¯ÊýÃû: stpcpy
¹¦ ÄÜ: ¿½±´Ò»¸ö×Ö·û´®µ½ÁíÒ»¸ö
ÓÃ ·¨: char *stpcpy(char *destin, char *source);
³ÌÐòÀý:
 
#include <stdio.h>
#include <string.h>
 
int main(void)
{
char string[10];
char *str1 = "abcdefghi";
 
stpcpy(string, str1);
printf("%s\n", string);
return 0;
}
 
 
 
 
º¯ÊýÃû: strcat
¹¦ ÄÜ: ×Ö·û´®Æ´½Óº¯Êý
ÓÃ ·¨: char *strcat(char *destin, char *source);
³ÌÐòÀý:
 
#include <string.h>
#include <stdio.h>
 
int main(void)
{
char destination[25];
char *blank = " ", *c = "C++", *Borland = "Borland";
 
strcpy(destination, Borland);
strcat(destination, blank);
strcat(destination, c);
 
printf("%s\n", destination);
return 0;
}
 
 
 
 
º¯ÊýÃû: strchr
¹¦ ÄÜ: ÔÚÒ»¸ö´®ÖвéÕÒ¸ø¶¨×Ö·ûµÄµÚÒ»¸öÆ¥ÅäÖ®´¦\
ÓÃ ·¨: char *strchr(char *str, char c);
³ÌÐòÀý:
 
#include <string.h>
#include <stdio.h>
 
int main(void)
{
char string[15];
char *ptr, c = 'r';
 
strcpy(string, "This is a string");
ptr = strchr(string, c);
if (ptr)
printf("The character %c is at position: %d\n", c, ptr-string);
else
printf("The character was not found\n");
return 0;
}
 
 
 
 
º¯ÊýÃû: strcmp
¹¦ ÄÜ: ´®±È½Ï
ÓÃ ·¨: int strcmp(char *str1, char *str2);
¿´AsicÂ룬str1>str2£¬·µ»ØÖµ > 0£»Á½´®ÏàµÈ£¬·µ»Ø0
³ÌÐòÀý:
 
#include <string.h>
#include <stdio.h>
 
int main(void)
{
char *buf1 = "aaa", *buf2 = "bbb", *buf3 = "ccc";
int ptr;
 
ptr = strcmp(buf2, buf1);
if (ptr > 0)
printf("buffer 2 is greater than buffer 1\n");
else
printf("buffer 2 is less than buffer 1\n");
 
ptr = strcmp(buf2, buf3);
if (ptr > 0)
printf("buffer 2 is greater than buffer 3\n");
else


Ïà¹ØÎĵµ£º

C/C++µ¥Ôª²âÊÔÀíÂÛ¾«Òª£¨Ò»£©

ÄÚÈݽéÉÜ
   
  ±¾ÏµÁÐÎÄÕ¸ù¾Ý¡¶µ¥Ôª²âÊÔÓëVU2.6Ó¦Óá·ÊÓÆµ½²×ùµÄÀíÂÛ²¿·ÖÕûÀí¶ø³É£¬Ö÷ÒªÌÖÂÛËĸöÎÊÌ⣺ΪʲôÐèÒªµ¥Ôª²âÊÔ£¿ÔõÑùÕ÷·þ¿É²âÐÔÄÑÌ⣿ÔõÑù²ÅÄܸßЧÂʲâÊÔ£¿ÔõÑù±£Ö¤²âÊÔЧ¹û£¿Öصã²ûÊöµ¥Ôª²âÊԵĹؼüÎÊÌ⣬²»ÊÇÒ»°ã¸ÅÄÊʺÏÓÚ¶Ôµ¥Ôª²âÊÔÓÐÒ»¶¨Á˽âµÄ¶ÁÕß¡£
  ÔÚÑ¡Ôñ¹¤¾ßºÍʵʩ ......

CµÄenum struct ÒÔ¼° JavaµÄenum

 ÔÚcÖÐenumµÄʹÓúÍstructºÜÏñ
enum name{
a,b,c
};

 
struct name{
int a;
int b;
char c;
};

 
or
 
typedef struct{
int a;
int b;
char c;
}Name;

ʹÓõÄʱºò¶¼ÒªÏÈÉùÃ÷±äÁ¿
 
enum name n1,n2,n3;
n1=a;
n2=b;
n3=enum name(3-1);
struct name sn1,sn2;
s ......

unix cѧϰָÄÏ (Êé¼®,ѧϰ·½·¨µÈ)

ÒýÑÔ
¾¡¹Ü C ÓïÑÔÎÊÊÀÒѽü 30 Ä꣬µ«ËüµÄ÷ÈÁ¦ÈÔδ¼õÍË¡£C ÓïÑÔ¼ÌÐøÎüÒý×ÅÖÚ¶àµÄ¿ª·¢Õߣ¬ËûÃÇΪÁ˱àд¡¢ÒÆÖ²»òά»¤Ó¦ÓóÌÐò¶ø±ØÐëѧϰм¼ÄÜ¡£
±¾ÎÄÊÇΪÁËÂú×ã¶ÔCÓïÑÔ³õѧÕß»òÏëÌá¸ß×ÔÉíCÓïÑÔÐÞΪµÄ¿ª·¢ÈËÔ±µÄÐèÒª¶øÐ´µÄ¡£Ï£Íû¶ÔÄúµÄѧϰºÍ¹¤×÷ÓÐËù°ïÖú¡£ÄúÒ²Ðí²»ÔÞͬÆäÖеÄijЩ·½·¨£¬µ«ÎÒÃÇÏ£ÍûÄú»áϲ»¶ÆäÖеÄһЩ¡£
±¾Î ......

Ö¸Õë±äÁ¿µÄ¶¨ÒåºÍ³õʼ»¯[c][code]


Ô­Ìû£º
http://hi.baidu.com/pepsi360/blog/item/cc74be4412cf6789b3b7dcd4.html
#include <stdio.h>
struct Node
{
    int a;
    char b[10];
     Node *next;
};
main(void)
{
    char   *p=NUL ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ