64,682
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <sstream>
#include <string>
#include <strstream>
using namespace std;
//将整型转换成字符型
string int_to_string(int i)
{
ostringstream os;
os<<i;
return os.str();
}
string int_to_string1(int i)
{
ostrstream os;
os<<i;
return os.str();
}
int main()
{
cout<<int_to_string(20)<<endl;
cout<<int_to_string1(20)<<endl;
return 0;
}
20
20屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯葺葺
请按任意键继续. . .