1、cmp 是 compare,比较的缩写。
2、strcmp是C语言中头文件
假设有两组字符串cs和ct,当cs
即:两个字符串自左向右逐个字符相比(按ASCII值大小相比较),直到出现不同的字符或遇'\0'为止。如:"A"<"B" ,"a">"A" ,"computer">"compare" ,"comput">"comp"
strcmp函数原型为:int strcmp(const char *s1,const char * s2);
compare,比较的缩写
描述:比较串
#include
int strcmp(const char *s1,const char* s2);
int __far _fstrcmp(const char __far* s1,const char __far* s2);
s1,s2为要比较的串
strcmp与_fstrcmp函数按字典顺序比较串s1与s2,并返回一表示其关系的值,如下:
<0 s1小于s2
=0 s1等于s2
>0 s1大于s2
以上可参考Microsoft C/C++ 7.0运行库参考手册