721
edits
No edit summary |
|||
Line 87: | Line 87: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
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: <syntaxhighlight lang="c++" inline>Point2D sum = p0 + p1;</syntaxhighlight> (where p0 and p1 are of the class Point2D) | ||
<syntaxhighlight lang="c++"> | <syntaxhighlight lang="c++"> | ||
Point2D operator/(float f); | Point2D operator/(float f); |