// overloading class copy constructor #include using namespace std; class CRectangle { int *pWidth, *pHeight; public: CRectangle (); CRectangle (CRectangle& copyMe); CRectangle (int,int); int area (void) {return (*pWidth) * (*pHeight);} }; CRectangle::CRectangle () { pWidth = new int(5); pHeight = new int(5); } CRectangle::CRectangle (CRectangle& copyMe) { pWidth = new int(*(copyMe.pWidth)); pHeight = new int(*(copyMe.pHeight)); } CRectangle::CRectangle (int a, int b) { pWidth = new int(a); pHeight = new int(b); } void PrintRect (CRectangle printMe) { cout << "passed rect area: " << printMe.area() << endl; } int main () { CRectangle rect (3,4); cout << "rect area: " << rect.area() << endl; PrintRect(rect); return 0; }