您的位置:首页 > 其它

1.2 boost库学习--类型转换(数值类型to字符串)

2011-09-27 16:37 791 查看
#include <boost/lexical_cast.hpp>
using boost::lexical_cast;

#include <iostream>
using namespace std;

int main()
{
//int to string
string sInt = lexical_cast<string>(123);

//double to string
string sDou = lexical_cast<string>(123.123);

cout<<sInt<<endl;
cout<<sDou<<endl;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: