c语言,strcmpi(),将一个串中的一部分与另一个串比较, 不管大小写

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

函数名: strncmpi
功 能: 将一个串中的一部分与另一个串比较, 不管大小写
用 法: int strncmpi(char *str1, char *str2, unsigned maxlen);
程序

int main()

{
  char *buf1="AAA",*buf2="aaa";
  int pos;
  pos=strncmpi(buf1,buf2,3);
  //pos=strcmpi(buf1,buf2); 函数重载
  if(pos > 0)
     printf("buffer 2 is greater than buffer 1 ");
  if(pos < 0)
     printf("buffer 2 is less than buffer 1 ");
  if(pos == 0)
     printf("buffer 2 equals buffer 1 ");
   return 0;

 return 0;
}

原文地址:https://www.cnblogs.com/wsq724439564/p/3258174.html