string转int
string str = "123"; int n = atoi(str.c_str()); cout << n << endl;
int转string
#include <sstream>// int 转 string stringstream ss; int n = 123; string str; ss << n; ss >> str;
string 类型转换
原文:http://www.cnblogs.com/yuguangyuan/p/5938004.html