int strcmp(const char* str1, const char* str2);
这个函数是C标准库的函数,处理的是C风格0结尾字符数组字符串。
C++标准库中的string类有可以直接使用的<,>,<=,>=,==,!=运算符,通常也用不到这个函数。
_____________________________________________________________________________________________________________________
strcmp()处理的是C风格的字符串。
而这里用的是string类,2者是不同的。
____________________________________________________________________________________________________________________
***********************************************************************************************************************************************
strcmp函数原型为:
int strcmp(
const char *string1,
const char *string2
);
其参数是传统的char *型字符串,string型数据类型是不能作为其参数的。但可以通过string成员函数string::c_str()转换成char*类型。象这样调用:
strcmp(str1.c_str(), str2.c_str())