What is stream class and
stream object. Describe them in detail with an example.
C++ standard stream class - Feb 05, 2009 at 18:10 PM
by Anuja Changede
What
is stream class and stream object. Describe them in detail with an example.
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.
The answers to following questions will be made available soon. Keep
visiting.
What is stream
class and stream object. Describe them in detail with an example.
Provide and explain with an
example for stream classes for files.
Provide and explain with an
example for string stream classes.
Describe lexical cast
operator as an example.
What char* stream classes? Include example to explain it.
Also
read
What is virtual function? Explain with
an example.
A virtual function is a member function that is declared within a base class and
redefined by a derived class. To create virtual function, precede the
function’s declaration in the base class with the keyword virtual..............
A class is a user defined data type. It serves as a template
of the objects...........
Constructors are the member functions of the class that
executes automatically whenever an object.............
The mutable keyword allows the data member of a class to
change within a const member function..............
A reference must be initialized at the time of declaration whereas not needed
in case of pointer. A pointer can point to a null object...............
|