您的位置:首页 > 其它

stringstream字符串转换整数函数

2015-03-02 16:23 162 查看
#include <string>
#include <iostream>
#include <sstream>
using namespace std;

int main (void)
{
	string mystr ("1204");
	int myint;
	stringstream(mystr)>>myint;
	cout<<myint<<endl;
}
/*
2015年3月2日16:24:06
程序执行输出如下结果:
1204
请按任意键继续. . .
*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐