Cpp Standard Library 简明教程
C++ Library - <ios>
Introduction
C 标准库提供了一套广泛的输入/输出功能,我们将在随后的章节中看到。本章将讨论 C 语言编程所需的非常基础且最常用的 I/O 操作。
IOStream 类层次结构的输入输出基本类和类型,如下所示:
Other types
Sr.No. |
Member types |
Definition |
1 |
Input/output error conditions |
|
2 |
Stream offset type |
|
3 |
Stream position type |
|
4 |
Stream size type |
|
5 |
Wide stream position type |
Format flag manipulators (functions)
独立的标志(开关开启)−
Sr.No. |
Member types |
Definition |
1 |
Alphanumerical bool values |
|
2 |
Show numerical base prefixes |
|
3 |
Show decimal point |
|
4 |
Show positive signs |
|
5 |
Skip whitespaces |
|
6 |
Flush buffer after insertions |
|
7 |
Generate upper-case letters |
独立的标志(开关关闭)−
Sr.No. |
Member types |
Definition |
1 |
No alphanumerical bool values |
|
2 |
不显示数字进制前缀 |
|
3 |
不显示小数点 |
|
4 |
不显示正号 |
|
5 |
Do not skip whitespaces |
|
6 |
插入后不要强制刷新 |
|
7 |
不要生成大写字母 |
数字基础格式标志(“basefield” 标志) −
Sr.No. |
Member types |
Definition |
1 |
Use decimal base |
|
2 |
Use hexadecimal base |
|
3 |
Use octal base |
浮点格式标志(“floatfield” 标志) −
Sr.No. |
Member types |
Definition |
1 |
Use fixed floating-point notation |
|
2 |
Use scientific floating-point notation |
调整格式标志(“adjustfield” 标志) −
Sr.No. |
Member types |
Definition |
1 |
在内部位置插入字符来调整字段 |
|
2 |
将输出调整到左侧 |
|
3 |
将输出调整到右侧 |