且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用MinGW在C ++中将int转换为std :: string?

更新时间:2021-12-21 06:33:28

您是否考虑过使用字符串流?

Have you considered using a stringstream?

#include <sstream>

std::string itos(int i){
    std::stringstream ss;
    ss<<i;
    return ss.str();
}