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. 閱讀(791) 評論(0) 收藏 舉報
浙公網安備 33010602011771號