stirante

point.cpp

Sep 14th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include "point.h"
  2.  
  3. Point::Point(int _x, int _y) : x(_x), y(_y)
  4. {
  5.  
  6. }
  7. std::ostream& operator<<(std::ostream& s, const Point& p) {
  8.     s << "x: " << p.x << ", y: " << p.y;
  9.     return s;
  10. }
  11. Point& operator-(const Point& p1, const Point& p2) {
  12.     return Point(p1.x - p2.x, p1.y - p2.y);
  13. }
Add Comment
Please, Sign In to add comment