C++中如何将int类型转换成stdstring类型
可以使用std::to_string()函数将int类型转换成std::string类型。
例如:
int i = 123;
std::string str = std::to_string(i);
这将把整数123转换成字符串"123"。
原文地址: https://www.cveoy.top/t/topic/bylq 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
可以使用std::to_string()函数将int类型转换成std::string类型。
例如:
int i = 123;
std::string str = std::to_string(i);
这将把整数123转换成字符串"123"。
原文地址: https://www.cveoy.top/t/topic/bylq 著作权归作者所有。请勿转载和采集!