static-members/point.h - A variant of class Point with static members. | Lecture 4 - slide 25 : 40 Program 1 |
class Point { private: double x, y; static Point defaultPoint; // Cannot be initialized here. public: Point(double, double); Point(); // Default constructor relies on defaultPoint double getx () const; double gety () const; void move(double, double); double distance_to(Point) const; static Point origo(); static void setDefaultPoint(Point); static void setDefaultPoint(double, double); }; std::ostream& operator<<(std::ostream&, const Point&);