You need to create such a statement Point & operator + = (Point &, const Point &)

Closed due to the fact that the essence of the question is not clear by the participants user194374, AK , rjhdby , Regent , ermak0ff Jan 29 '17 at 8:25 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • In the "question" I see a statement of fact. I do not see the question. What is your question? - AnT

1 answer 1

struct Point { double x,y; }; Point& operator +=(Point&p, const Point& d) { px += dx; py += dy; return p; }; int main(int argc, const char * argv[]) { Point a{5,6}; Point b{7,8}; a += b; cout << ax << " " << ay << endl; }