extern int stricmp(const char *s1,const char * s2);
用法:#include <string.h>
功能:比较字符串s1和s2,但不区分字母的大小写。
说明:strcmpi是到stricmp的宏定义,实际未提供此函数。
当s1<s2时,返回值<0
当s1=s2时,返回值=0
当s1>s2时,返回值>0
举例:
#include <string.h>
int main(void)
{
char *s1="A!";
char *s2="B!";
int r=stricmp(s1,s2);
if(!r)
printf("s1 and s2 are identical");
else
{....}
return 0;
}
C++不区分大小写比较字符串是否相等
最新推荐文章于 2024-08-11 21:22:12 发布