721
edits
Line 84: | Line 84: | ||
<code> | <code> | ||
Point2D operator+(Point2D& p2); | Point2D operator+(Point2D& p2); | ||
<code> | </code> | ||
This function should add up two points and return a new Point2D, which is the sum of the two points. | This function should add up two points and return a new Point2D, which is the sum of the two points. | ||
If you implement this function you can then simply write: Point2D sum = p0 + p1; (where p0 and p1 are of the class Point2D) | If you implement this function you can then simply write: Point2D sum = p0 + p1; (where p0 and p1 are of the class Point2D) |