无论是标题出现的c++编译错误还是下方这种
[Error] no match for 'operator==' (operand types are 'std::string {aka std::basic_string<char>}' and 'int')
都是由于符号使用不匹配而所导致的
当我们使用string类时,给string类赋值应该使用双引号""
string s;
s="Hello World!";
倘若使用单引号或者不加引号就可能会出现以上的错误。
无论是标题出现的c++编译错误还是下方这种
[Error] no match for 'operator==' (operand types are 'std::string {aka std::basic_string<char>}' and 'int')
都是由于符号使用不匹配而所导致的
当我们使用string类时,给string类赋值应该使用双引号""
string s;
s="Hello World!";
倘若使用单引号或者不加引号就可能会出现以上的错误。