Professional Documents
Culture Documents
CS201 37
CS201 37
Lecture 37
Operator
Overloading
Operator Overloading
Stream Insertion /
Extraction
int i ;
cin >> i ;
int a , b , c ;
a+b+c;
cin >> i >> j ;
Friend
Function
Member
Operators
Object.data
Object.function ( )
Stream Insertion Operator
int i = 5 , j = 10 , k = 15 ;
cout << i << j << k ;
Return type:
Reference to the output stream
Operator
}
}
ostream & operator << ( ostream & output , vehicle A )
Matrix m ;
m.getMatrix ( ) ;
m.displayMatrix ( ) ;
Example
Matrix m ;
cin >> m ;
cout << m ;