c++编程:string a = "bcd";int e = strcmp(a,"bcd");cout<<e<<endl;编译使报错:错误: 不能将‘int strcmp(const char*, const char*)’的实参‘1’从‘std::string {aka std::basic_string<char>}’转换到‘const char*’难道用string 类就不能比较了么?非得把string换成char*?有别的比较办法么?
添加回答
举报
0/150
提交
取消