C++ Stream Class
C++ accomplishes input/output operations using concept of stream. A stream is a series of bytes whose value depends on the variable in which it is stored. This way, C++ is able to treat all the input and output operations in a uniform manner. Thus, whether it is reading from a file or from the keyboard, for a C++ program it is simply a stream.
We have used the objects cin and cout (pre-defined in the iostream.h file) for the input and output of data of various types. This has been made possible by overloading the operators >> and << to recognize all the basic C++ types.
A stream is a sequence of bytes. It acts either as a source from which the input data can be obtained or as a destination to which the output data can be sent. The source stream that provides data to the program is called the output stream. In other words, a program extracts the bytes from an input stream and inserts bytes into an output stream.

Stream Classes for Console Operations
Class Name | Contents |
ios (General I/O stream class) | Contains basic facilities that are used by all other input and output classes. |
istream (Input stream) | Inherits the properties of ios. |
Ostream (output stream) | Inherits the properties of ios. |
iostream (I/O stream) | |
Streambuf | Provides an interface to physical devices through buffers. |
You must log in to post a comment.