0% found this document useful (0 votes)
138 views9 pages

C++ Operator Overloading Guide

The document discusses overloading input and output operators in C++ and type conversions between basic and class types. It explains that input and output operators can be overloaded to work with user-defined types by extending the capabilities of >> and <<. It also covers three types of type conversions - basic to class, class to basic, and class to class - and mentions that basic to class conversion can be done through constructors or operator overloading.

Uploaded by

supriya028
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
138 views9 pages

C++ Operator Overloading Guide

The document discusses overloading input and output operators in C++ and type conversions between basic and class types. It explains that input and output operators can be overloaded to work with user-defined types by extending the capabilities of >> and <<. It also covers three types of type conversions - basic to class, class to basic, and class to class - and mentions that basic to class conversion can be done through constructors or operator overloading.

Uploaded by

supriya028
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

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

You might also like