书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

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.  阅读(777)  评论(0编辑  收藏  举报

导航

书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!