#include using namespace std ; class point { public: int x1 ; int y1 ; point operator+( const point& param1 ); friend ostream& operator<<(ostream& os, const point& param1) ; }; point point::operator+( const point& param1 ) { cout << "Calling operator + member function." << endl ; point pointObj ; pointObj.x1 = x1 + param1.x1 ; pointObj.y1 = y1 + param1.y1 ; return pointObj ; } ostream& operator<<(ostream& os, const point& param1) { os << param1.x1 << " " << param1.y1 << endl ; return os; } int main() { point point1 ; point1.x1 = 1 ; point1.y1 = 1 ; point point2 ; point2.x1 = 2 ; point2.y1 = 2 ; cout << point1 << endl ; cout << point2 << endl ; return 0 ; }