OVERLOADING OF STREAM
FUNCTION
&
BASIC TO CLASS TYPE
CONVERSION
NAME : ASHISH KUMAR
ROLL NO. - 20
BCA – 2ND YEAR
Overloading Input and output operators
C++ allows input and output of built-in data types using stream extraction operator >>
and the stream insertion operator <<.
The capabilities of these operators can be extended to perform input and output for
user-defined types.
cin is an object of istream class & cout is an object of the stream class.
OUTPUT
OUTPUT
TYPE
CONVERSION
BASIC TO CLASS CLASS TO BASIC CLASS TO CLASS
TYPE TYPE TYPE
CONVERSION FROM BASIC TO CLASS TYPE
In this type of conversion the source type is basic type and the destination type is class
type. Means basic data type is converted into the class type.
The conversion from basic type to the class type can be performed by two ways:
i. Using constructor
ii. Using Operator Overloading
OUTPUT
OUTPUT