Created
September 24, 2015 17:17
-
-
Save seiflotfy/1245d281d59ac7e21924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Punkt | |
{ | |
public: | |
// Overload + operator to add two Punkt objects. | |
Punkt operator+(const Punkt& p) | |
{ | |
Punkt new_p; | |
new_p.x = x + p.x; | |
new_p.y = y + p.y; | |
return new_p; | |
} | |
private: | |
double x; | |
double y; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment