11.2 STREAM I/O CLASSES

The system starts with the base class “ios”. It provides operations common to both input and output. It is defined in a header file “iostream.h”. For formatted input, a class is derived from ios. It is named istream. Class ostream is for output. A class both for formatted input and output is iostream. Input/output depends on external physical devices. Class “streambuf” provides an abstraction for talking to these devices. Classes derived from it deal with files, memory and so on. Class ios talks to a streambuf. It maintains information on the state of the class streambuf. It maintains flags for use by istream and ostream. The above information is summarized in Figure 11.1.

 

 

Figure 11.1 ios class diagram

 

Table ...

Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.