[c++].タイプ変換
848 ワード
int to string
1.
2.
1.
int n = 65535;
char t[256];
string s;
// char[] , string
sprintf(t, "%d", n);
s = t;
2.
int n = 65535;
stringstream ss;
string s;
ss << n;
ss >> s;
cout << s << endl;
// #include<sstream>