将整型转换为字符串: #include <sstream> using namespace std; ... stringstream sstrm; sstrm << 123; return sstrm.str();