The C++ I/O system supplies an interface to the programmer that is independent of the actual device being accessed. This interface is known as stream. The I/O system contains a hierarchy of the stream classes used to define various streams to deal with the console and disk files. These classes are known as stream classes. The base stream class for handling input and output operations with the console and disk is ios and there are various classes derived from it such as istream, ostream, streambuf etc.
The header file <iostream> declares the stream classes.
As part of the library, the iostream declares certain objects that are used to perform input and output operations. These are known as Stream objects. They are cin, cout, cerr, clog etc.


guy's is this correct plssssssssssss give ur valuable feedback

tanx in advance

Is this supposed to be a response to a question on an exam or something?

It is only partially correct. If I were the instructor, I would probably take away about half of this question's points.

First, this statement is only partially true:

The base stream class for handling input and output operations with the console and disk is ios and there are various classes derived from it such as istream, ostream, streambuf etc.

Only the istream and ostream classes inherit directly from ios, which in turn inherits from ios_base. The streambuf class however does not. Look at this.

Second, this statement is false:

The header file <iostream> declares the stream classes.

The header <iostream> declares the objects used for standard I/O (cin, cout, etc.) which are typically linked to the console, but they can be redirected. These objects are instances of the istream and ostream classes which are defined in their own headers. This header is not responsible for all stream classes. There are other headers that must be used for file streams, string streams, streambufs, etc. You can find this information on the page that I previously linked for you.

Edited 6 Years Ago by Fbody: n/a

ya this is one of the questions i got 4 my assignment

y wats wrong in my assignment please explain me

This article has been dead for over six months. Start a new discussion instead.