boost::lexical_cast
生活随笔
收集整理的這篇文章主要介紹了
boost::lexical_cast
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
編譯有boost庫即可 不需要加特殊編譯命令
#include <iostream> #include <boost/lexical_cast.hpp> #include <string> using namespace std;int main() {int num = 0;string str1 = "this is test ";string str3;for ( num = 0; num < 10; num++){string str2 = boost::lexical_cast<std::string>(num);str3 = str1 + str2;printf("%s\n",str3.c_str());} return 0; }假如又問題 嘗試添加:
/*
g++?3test.cpp?-L/usr/local/lib?-lboost_serialization?
第一次編譯要加?-L/usr/local/lib?-lboost_serialization?
*/
或者/*
g++?3test.cpp?-L/usr/local/lib?-lboost_serialization?
第一次編譯要加?-L/usr/local/lib?-lboost_serialization?
或者g++?.....?-lboost_serialization?
*/
?
總結
以上是生活随笔為你收集整理的boost::lexical_cast的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: u盘打开以后发现文件变乱码的解决方法
- 下一篇: makefile例子