Introduction
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.
Input-Output base classes and types for the IOStream hierarchy of classes as shown below −
Types
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 |
Numerical base format flags (“basefield” flags) −
Sr.No. | Member types | Definition |
---|---|---|
1 | Use decimal base | |
2 | Use hexadecimal base | |
3 | Use octal base |
Floating-point format flags (“floatfield” flags) −
Sr.No. | Member types | Definition |
---|---|---|
1 | Use fixed floating-point notation | |
2 | Use scientific floating-point notation |
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 |