#ifndef POINT_H #define POINT_H #include //for class ostream using namespace std; class point { private: double x; double y; public: //Two-argument constructor. point(double init_x, double init_y): x {init_x}, y {init_y} {} //The default constructor puts the origin into the newborn object. point(): x {0.0}, y {0.0} {} //The "copy constructor". point(const point& another): x {another.x}, y {another.y} {} point& operator=(const point& another) { //non-const member function x = another.x; y = another.y; return *this; } friend ostream& operator<<(ostream& ost, const point& p) { return ost << "(" << p.x << ", " << p.y << ")"; } }; #endif