background image

          printf("buffer2isgreaterthanbuffer3\n"); 
      else 
          printf("buffer2islessthanbuffer3\n"); 

      return0; 
 } 

函数名:strncmpi 

 

功 能: 将一个串中的一部分与另一个串比较, 

 

不管大小写

 

用 法:intstrncmpi(char*str1,char*str2,unsignedmaxlen); 
程序例: 

#include<string.h> 
#include<stdio.h> 

intmain(void) 

     char*buf1="BBB",*buf2="bbb"; 
     intptr; 

     ptr=strcmpi(buf2,buf1); 

     if(ptr>0) 
         printf("buffer2isgreaterthanbuffer1\n"); 

     if(ptr<0) 
         printf("buffer2islessthanbuffer1\n"); 

     if(ptr==0) 
         printf("buffer2equalsbuffer1\n"); 

     return0; 

函数名:strcpy 

 

功 能: 

 

串拷贝

 

用 法:char*strcpy(char*str1,char*str2); 
程序例: 

#include<stdio.h> 
#include<string.h> 

intmain(void) 
  {