PJF16

Operator overloading

Jun 1st, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1.     Point & operator ++ () {
  2.         this->x = this->x +1;
  3.         this->y = this->y +1;
  4.         return *this;
  5.     }
  6.    
  7.     Point operator ++ (int) {
  8.         Point help(*this);
  9.         ++*this;
  10.         return help;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment