Skip to content

Instantly share code, notes, and snippets.

@seiflotfy
Created September 24, 2015 17:17
Show Gist options
  • Save seiflotfy/1245d281d59ac7e21924 to your computer and use it in GitHub Desktop.
Save seiflotfy/1245d281d59ac7e21924 to your computer and use it in GitHub Desktop.
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