我需要返回 std::string:
IntegerValue::(std::string) toString() {
std::string a = std::to_string(this -> value);
return a;
}
但是 GCC 编译器说“语法错误”。怎么了?
最佳答案
语法是:
std::string IntegerValue::toString() {
std::string a = std::to_string(this -> value);
return a;
}
关于c++ - 从一个对象的方法返回 std::string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20594224/