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