stricmp——不区分大小写比较字符串
函数名: stricmp
功 能: 以不区分大小写方式比较两个串
用 法: int stricmp(char *str1, char *str2);
stricmp = stricmp
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char buf2[5] ="Abbb", *buf1 = "cBBB" ;
int ptr;
ptr = stricmp(buf2, buf1);
if(ptr>0)
cout<<"buffer2 is greater than buffer1"<<endl;
if(ptr<0)
cout<<"buffer2 is less than buffer1"<<endl;
if(ptr==0)
cout<<"buffer2 equals buffer1"<<endl;
}
posted on 2011-11-22 21:34 More study needed. 阅读(781) 评论(0) 编辑 收藏 举报