您的位置:首页 > 其它

(转)stringstream类的使用(实现string类型与其余类型的转化)

2011-04-24 16:54 363 查看
转自论坛帖子 http://topic.csdn.net/u/20100412/16/2a9a0c15-63e7-4bd5-8019-6c3959540adf.html

C/C++ code
#include <iostream>
#include <string>
#include<sstream>
using namespace std;
int main()
{
string s="123";
stringstream st;
int a;
st<<s;
st>>a;
cout<<a<<endl;
system("pause");
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: