c++ 忽略大小写比较两个字符串的前n哥字符 strncasecmp
#include <string.h>
#include <stdio.h>
int main(){
char *a = "aBcDeF";
// char *b = "AbCdEf";
char *b = "A";
if(!strncasecmp(a, b, 3)) // 注意此处存在符号“!”
{
printf("%s =%s\n", a, b);
}
return 0;
}