1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream> #include <string> #include <sstream> using namespace std; int main(int argc, char const* argv[]) { int i = 10; string str; stringstream ss; ss << i; ss >> str; cout << str << endl; return 0; }
1
10