int ---> string
方法一:
#include <iostream>
#include <string>
using
namespace
std;
int
main()
{
int
n = 65535;
char
t[256];
string s;
sprintf
(t,
"%d"
, n);
s = t;
cout << s << endl;
return
0;
}
方法二:
#include <iostream>
#include <string>
#include <stringstream>
using
namespace
std;
int
main()
{
int
n = 65535;
stringstream ss;
string s;
ss << n;
ss >> s;
cout << s << endl;
return
0;
}