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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章