strcat()函数

strcmp()函数

ClimbCM posted @ Mar 12, 2009 03:52:34 AM in C语言基本函数库实现 with tags c string , 846 阅读


/*两个字符串比较大小*/
int strcmp(const char *src,const char *dst){
 int ret=0;
 while(!(ret=*(unsigned char*)src-*(unsigned char*)dst)&&*src)
  ++src,++dst;
 if(ret<0)ret=-1;
 else if(ret>0)ret=1;
 return(ret); }