需要的头文件:#include<sstream>

操作:

string s1="124";

int x;

stringstream ss;
ss<<s1;
ss>>x;

相关文章: