包含头文件、使用命名空间:
#include <sstream>
using namespace std;
string->int :
string str = "0";
stringstream strStream;
strStream<<str;
int val;
strStream>>val;
int->string :
int val = 0;
stringstream strStream;
strStream<<val;
string str = strStream.str();