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

#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;
}


你可能感兴趣的:(include)