我的编译器不认识to_string函数
如果你的编译器不认识to_string函数,可能是因为你的编译器不支持C++11标准。你可以尝试在编译器选项中启用C++11标准,或者自己实现一个to_string函数。以下是一个简单的实现示例:
template <class T>
std::string to_string(T value)
{
std::ostringstream os;
os << value;
return os.str();
}
这个函数使用ostringstream流将任何类型的值转换为字符串。
原文地址: https://www.cveoy.top/t/topic/c0zC 著作权归作者所有。请勿转载和采集!