int转string
1 #include <string> 2 #include <sstream> 3 int n = 0; 4 stringstream ss; 5 string str; 6 ss<<n; 7 ss>>str;
string转int
1 #include <string> 2 std::string str = "123"; 3 int n = atoi(str.c_str());