strcmp函数

function:按顺序依次比较两个字符数组的每个字符的ASCILL值

    if(str1>str2) strcmp(str1,str2)>0;

    if(str1==str2) strcmp(str1,str2)=0;

    if(str1<str2) strcmp(str1,str2)<0;

for example:"111"<"12"   "11"<"111"  "123"<"124"

不能比string类型的  

unless通过函数c_str()将string类型的转化为字符数组类型:str1.c_str();

原文地址:https://www.cnblogs.com/Cnxz/p/12337692.html