码迷,mamicode.com
首页 > 其他好文 > 详细

int转string

时间:2016-10-14 23:31:13      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:

#include<iostream>
#include<sstream>
#include<string>
using namespace std;

int main()
{
    int a = 5;
    ostringstream os;
    os << a;
    string s = os.str();
    cout << s << endl;
    return 0;
}

 

int转string

标签:

原文地址:http://www.cnblogs.com/argenbarbie/p/5962160.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!