setf
| independent flags | boolalpha | read/write bool elements as alphabetic strings (true and false). |
| showbase | write integral values preceded by their corresponding numeric base prefix. | |
| showpoint | write floating-point values including always the decimal point. | |
| showpos | write non-negative numerical values preceded by a plus sign (+). | |
| skipws | skip leading whitespaces on certain input operations. | |
| unitbuf | flush output after each inserting operation. | |
| uppercase | write uppercase letters replacing lowercase letters in certain insertion operations. | |
| numerical base (basefield) |
dec | read/write integral values using decimal base format. |
| hex | read/write integral values using hexadecimal base format. | |
| oct | read/write integral values using octal base format. | |
| float format (floatfield) |
fixed | write floating point values in fixed-point notation. ---------usually used 将浮点数用定点数表示 |
| scientific | write floating-point values in scientific notation. 科学计数法 | |
| adjustment (adjustfield) |
internal | the output is padded to the field width by inserting fill characters at a specified internal point. 特定处补零 |
| left | the output is padded to the field width appending fill characters at the end. 结束补零 | |
| right | the output is padded to the field width by inserting fill characters at the beginning. 开头补零 |
std::cout.setf ( std::ios::showbase ); 带0x 等前缀。
setf的更多相关文章
- Difference between SET, SETQ and SETF in LISP
SET can set the value of symbols; SETQ can set the value of variables; SETF is a macro that will ...
- cout.setf()
cout用来实现格式输出,类似于C语言中通过printf(). cout.setf()的作用是通过设置格式标志来控制输出形式,如,其中ios_base::fixed表示:用正常的记数方法显示浮点数(与 ...
- C++中cout.setf()和cout.precision()
这两个就是格式控制的~ostream成员函数里面的,也可以用输出流操作符来控制,都一样的~附给你一些看看~ 其中cout.setf跟setiosflags一样的,cout.precision跟setp ...
- C++中的cout.setf(ios::fixed)是什么意思?
问题描述:在阅读一段代码时,发现代码的最后一部分出现 ... cout.setf(ios::fixed); cout.setf(ios::showpoint); ... 解决: cout.setf() ...
- ANSI Common Lisp Practice - My Answers - Chatper - 3
Ok, Go ahead. 1 (a) (b) (c) (d) 2 注:union 在 Common Lisp 中的作用就是求两个集合的并集.但是这有一个前提,即给的两个列表已经满足集合的属性了.具体 ...
- 使用Proj库进行大地坐标转空间坐标、投影坐标的一个示例
最近研究了proj库的使用,自己写了一个小demo,仅供参考. void demoPROJ() { const char* wgs84 = "+proj=tmerc +ellps=WGS84 ...
- cout 格式化输出
一直习惯于C语言的printf函数来打印,突然有一天要用cout来打印,发现有点不适应. 原来cout也是有格式化输出的. 首先要引入头文件 #include<iostream> // 在 ...
- 第三方框架之ThinkAndroid 学习总结(一)
ThinkAndroid是一个免费的开源的.简易的.遵循Apache2开源协议发布的Android开发框架,其开发宗旨是简单.快速的进行Android应用程序的开发,包含Android mvc.简易s ...
- c/c++头文件_string
string, cstring, string.h 一.string头文件 主要包含一些字符串转换的函数 // sto* NARROW CONVERSIONS// sto* WIDE CONVERSI ...
随机推荐
- 转:Qt编写串口通信程序全程图文讲解
转载:http://blog.csdn.net/yafeilinux/article/details/4717706 作者:yafeilinux (说明:我们的编程环境是windows xp下,在Q ...
- css设置水平垂直居中
关于CSS设置水平以及垂直居中的解决方案 想要水平居中? 内联的元素(文字)? .center-children { text-align: center;} 块级元素? .center-me { m ...
- 杜教的AAA树
膜膜膜,常数挺小的... #include<iostream> #include<cstdio> #include<cmath> #include<algor ...
- 【8】JAVA---地址App小软件(AddrDaoFile .class)(数据层)
实现数据进行文件的存储和读写. 本软件也就到此结束了. 没多少可以讲的. 因为这个小软件也就8个类,主要学习的也就是一个分层思想的简单应用. package cn.hncu.addr.dao; imp ...
- 上海游侠电动汽车团队招募。iOS,Android,产品经理以及 SEVER 端工程师 - V2EX
上海游侠电动汽车团队招募.iOS,Android,产品经理以及 SEVER 端工程师 - V2EX 上海游侠电动汽车团队招募.iOS,Android,产品经理以及 SEVER 端工程师
- 转:Java生成图片验证码(有点仿QQ验证码的意思)
http://blog.csdn.net/ruixue0117/article/details/22829557 java: VerifyCodeUtils.java package com.fro. ...
- ubuntu dash
缘由:写一些脚本放在/etc/rc.loca自动执行开机启动报错 fiail to start /etc/rc.local 查找资料 缘起:ubuntu在6.0后默认bash改为了dash 导致很多 ...
- PHP各版本之间差异
PHP5.3 __toString 魔术方法不再接受参数. 魔术方法 __get, __set, __isset, __unset, and __call 应该总是公共的(public)且不能是静态的 ...
- javascript 单个图片的淡入淡出效果和多张图片的淡入淡出效果
最近刚好在看之前妙趣网站的javascript 初级运动教程,教程里说设置图片的透明度使用了一个变量.这种方法确实不错,但是燕姐喜欢麻烦.就用自己的理解方法写了一遍.其中也是各种坑.现在先把一个图片的 ...
- [Angular 2] Using Array ...spread to enforce Pipe immutability
Pipes need a new reference or else they will not update their output. In this lesson you will use th ...