boost helloworlld
生活随笔
收集整理的這篇文章主要介紹了
boost helloworlld
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原文地址:
使用環境ubuntu g++
安裝boost只需要運行
apt-get install libboost-dev libboost-dbg libboost-doc bcp libboost-*
運行完畢就安裝完了
第一個例子,是使用boost中的lexical_cast組件的
#include <iostream>
int main()
{
using boost::lexical_cast;
int a = lexical_cast<int>("123");
double b = lexical_cast<double>("123.12");
std::cout<<a<<std::endl;
std::cout<<b<<std::endl;
return 0;
}
輸出:
m@m:~/a$ ./boost123
123.12
保存成文件boost.cc
運行 g++ -g -Wall -O0 boost.cc -o boost
生成執行文件./boost
完
轉載于:https://www.cnblogs.com/wangkangluo1/archive/2011/07/19/2110881.html
總結
以上是生活随笔為你收集整理的boost helloworlld的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 解决前端跨域的八种方案
- 下一篇: 新后缀再开放,投资者应谨慎对待!