C++中将string类型变量转换成int型变量

时间:2014-05-27 00:06:46   收藏:0   阅读:266

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

操作:

string s1="124";

int x;

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

C++中将string类型变量转换成int型变量,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!