#ifndef POINTH #define POINTH #include using namespace std; ostream& cartesian(ostream& ost); ostream& polar(ostream& ost); class point { static const int subscript; //subscript of new element in iword "array" double x, y; public: point(double initial_x = 0, double initial_y = 0) : x(initial_x), y(initial_y) {} friend ostream& cartesian(ostream& ost) { ost.iword(subscript) = 0; //Cartesian coordinates return ost; } friend ostream& polar(ostream& ost) { ost.iword(subscript) = 1; //polar coordinates return ost; } friend ostream& operator<<(ostream& ost, const point& p); }; #endif