# include <iostream>
class Point
{
public:
Point(int x_ = 0, int y_ = 0) : x(x_) , y(y_){}
Point(const Point & rhs)
{
x = rhs.x;
y = rhs.y;
}
Point & operator=(const Point & rhs)
{
if(this != &rhs)
{
x = rhs.x;
y = rhs.y;
}
return *this;
}
virtual ~Point(){}
protected:
int x;
int y;
};
int main()
{
Point p1(1,3); // costruttore con parametri
Point p2(p1); //costruttore di copia
Point p3; // default constructor con 0,0
p3 = p2; // copy assignment
}
eccoti.