// Point.cpp #include #include "Point.h" // costruttore classe Point Point::Point( int a, int b ) { cout << "Costruttore del punto (" << a << "," << b << ") in esecuzione" << endl; setPoint( a, b ); } // set coordinate x e y void Point::setPoint( int a, int b ) { x = a; y = b; } // get coordinata x int Point::getX() const { return x; } // get coordinata y int Point::getY() const { return y; } // overloading operatore di stampa su cout ostream &operator<<( ostream &output, const Point &p ) { output << '[' << p.getX() << ", " << p.getY() << ']'; return output; // enables cascaded calls }