Stream-classes-hierarchy-in-C++ .

In this session i have discuss stream classes hierarchy in C++ .


The stream is a sequence of bytes . C++ has many stream classes as follows .


The following figure shows the stream classes hierarchy .

c++ stream image

In the above figure ios is the base class for istream and ostream . Later it in turn iostream class . The ios class declare as virtual base class .


ios

The ios contains all the basic facilities that are used by input ad output classes .


istream

The istream is called the input stream class . That take the input from the user like keyboard or other input device . It is provide functions like get() , getline() and read() . It contains the extraction operator >> . It is inherited from ios class .


ostream

The ostream class is called the output stream class . It is send the data to output device like monitor . It is provide the function like put() and write (). It contains the overloaded insertion operator << . It is also inherited from ios class .


iostream

The iostream is called the input and output stream . It is inherited from ios istream and ostream . So it contains all the input output functions .


streambuf

It provide an interface to physical device through buffer .

Welcome to AndroidATPoint.

back image                     next image