The C++ I/O system contains a hierarchy of classes that are used to define various streams to deal with both the console and disk files. This classes are called String Classes. These classes are declared in the header file iostream.This file should be included in all the programs that communicate with the console unit.

 

Stream classes for console I/O operations

 

ios is the base class for istream(input stream)and ostream(output stream) which are ,in turn, base classes for iostream(input/output stream).The class ios is declared as the virtual base class so that only one copy of its members are inherited by the iostream.
            The class ios provides the basic support for formatted and unformatted I/O operations. The class istream provides the facilities for formatted and unformatted input while the class ostream provides the facilities for formatted and unformatted  output. The class iostream provides the facility for handling both input and output streams. Three classes,namely,istream_withassign,ostream_withassign and iostream_withassign add assignment operators these classes.

ios (General input/output stream class)

  1. Contains basic facilities that are used by all other input and output classes.
  2. Also contains a pointer to a buffer object(streambuf object).
  3. Declares constants and functions that are necessary for handling formatted input and output operation.

istream(input stream)

  1. Inherits the properties of ios
  2. Declares input functions such as get(),getline() and read().
  3. Contains overloaded extraction operator.

ostream(output stream)

  1. Inherits the properties of ios
  2. Declares output functions such as put() and write().
  3. Contains overloaded initiation operator.

iostream(input/output stream)

  1. Inherits the properties of ios istream and ostream through multiple inheritance and thus contains all the input and output functions.

Streambuf
           

  1. Provides an interface to physical devices through buffers.
Acts as a base for filebuf class used ios files.