迷路的龙猫

Hacking the interesting world!

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2014年3月2日

摘要: 在书中看到一段代码,使用到了std::setw()这个方法,记录一下用法。这个方法用来设定输入或者输出流中的缓冲区的宽度(set field width).这个方法定义在头文件中。可用来对齐输出的文本流或者截取部分数据。示例1:参考自cpluspluswww.cplusplus.com/reference/iomanip/setw/// setw example#include // std::cout, std::endl#include // std::setwint main () { std::cout 2 #include 3 #include 4 ... 阅读全文
posted @ 2014-03-02 20:18 迷路的龙猫 阅读(3021) 评论(0) 推荐(0) 编辑