boost::format, std::stringstream
来源:互联网 发布:linux网络代理服务器 编辑:程序博客网 时间:2024/06/07 18:54
stringstream完全适用, boost::format感觉代码可读性不好,可能还不习惯吧
#include <iostream>#include <boost/format.hpp>#include <string>#include <sstream>int _tmain(int argc, _TCHAR* argv[]){std::string str = "sum";int i = 100, j = 200;std::cout << boost::format("%s:%d+%d=%d")%str%i%j%(i+j) << std::endl;boost::format fm("product:%1% * %2% = %3%");std::cout << fm %3 %5 %(3*5) << std::endl;int *p = &i;std::cout << boost::format("address:0x%x")%p << std::endl;std::stringstream ss;ss << str << ":" << i << "+" << j << "=" << i+j;std::cout << ss.str() << std::endl;system("pause");return 0;}
- boost::format, std::stringstream
- boost::format给std::string插上翅膀
- std::stringstream
- std::strstream和std::stringstream
- std::stringstream 的介绍
- std::stringstream 取代 sprintf
- std::stringstream 数据转换
- std::stringstream用法
- std::stringstream 用法
- std::stringstream的用法
- 探究std::stringstream
- std::stringstream 用法
- boost::format
- boost::format
- BOOST::Format
- boost::format
- boost::format
- std::getline (string) & std::stringstream::str
- 重构机房收费系统总结
- 获取视频和图片缩略图 与媒体信息
- 闲话互联网
- boost::shared_ptr与std::tr1::shared_ptr
- boost function bind用法
- boost::format, std::stringstream
- GCC 参数详解
- cp指令详解及“略过文件”解决
- socket的select函数
- boost daytime client/server
- 任正非演讲系列之——华为的冬天
- 网站建设
- LFS学习(6)安装工具链
- YYXT之IT工作小记(二)