功 能: 將一個串中的一部分與另一個串比較, 不管大小寫
用 法: int strnicmp(char *str1, char *str2, unsigned maxlen);
程式例:
#include <string.h>
#include <stdio.h>
int main(void)
{
char *buf1 = "BBB", *buf2 = "bbb";
int ptr;
ptr = strnicmp(buf2, buf1);
if (ptr > 0)
printf("buffer 2 is Greater than buffer 1\n");
else if (ptr < 0)
printf("buffer 2 is less than buffer 1\n");
else
printf("buffer 2 equals buffer 1\n");
return 0;
}