Cpp Standard Library 简明教程
C++ Library - <ios>
Introduction
C 标准库提供了一套广泛的输入/输出功能,我们将在随后的章节中看到。本章将讨论 C 语言编程所需的非常基础且最常用的 I/O 操作。
The C standard libraries provide an extensive set of input/output capabilities which we will see in subsequent chapters. This chapter will discuss very basic and most common I/O operations required for C programming.
IOStream 类层次结构的输入输出基本类和类型,如下所示:
Input-Output base classes and types for the IOStream hierarchy of classes as shown below −
Class templates
Sr.No. |
Member types |
Definition |
1 |
Base class for streams (type-dependent components |
|
2 |
Stream position class template |
Classes
Sr.No. |
Member types |
Definition |
1 |
Base class for streams (type-dependent components) |
|
2 |
Base class for streams |
|
3 |
Base class for wide character streams |
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)
独立的标志(开关开启)−
Independent flags (switch on) −
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 |
独立的标志(开关关闭)−
Independent flags (switch off) −
Sr.No. |
Member types |
Definition |
1 |
No alphanumerical bool values |
|
2 |
Do not show numerical base prefixes |
|
3 |
Do not show decimal point |
|
4 |
Do not show positive signs |
|
5 |
Do not skip whitespaces |
|
6 |
Do not force flushes after insertions |
|
7 |
Do not generate upper case letters |
数字基础格式标志(“basefield” 标志) −
Numerical base format flags ("basefield" flags) −
Sr.No. |
Member types |
Definition |
1 |
Use decimal base |
|
2 |
Use hexadecimal base |
|
3 |
Use octal base |
浮点格式标志(“floatfield” 标志) −
Floating-point format flags ("floatfield" flags) −
Sr.No. |
Member types |
Definition |
1 |
Use fixed floating-point notation |
|
2 |
Use scientific floating-point notation |
调整格式标志(“adjustfield” 标志) −
Adustment format flags ("adjustfield" flags) −
Sr.No. |
Member types |
Definition |
1 |
Adjust field by inserting characters at an internal position |
|
2 |
Adjust output to the left |
|
3 |
Adjust output to the right |