This is my code
Code:
friend Point operator-(const Point*, const Point*);
Code:
Point operator-(const Point* pt1, const Point* pt2){
int x = pt1->x - pt2->x;
int y = pt1->y - pt2->y;
return Point(x, y);
}
yes I am trying to use Point* Instead of Point&
I am getting this Following Error
Code:
oops_member_op_overload.cpp:26: error:
‘Point operator-(const Point*, const Point*)’ must have an argument of class or enumerated type
oops_member_op_overload.cpp:51: error:
‘Point operator-(const Point*, const Point*)’ must have an argument of class or enumerated type