Challenge 2: Observing the Destructor Fire at Scope Exit — Possible Solution ==================================================================== #include class Rectangle { private: double width; double height; public: Rectangle(double w, double h) { width = w; height = h; } ~Rectangle() { std::cout << "Rectangle destroyed" << std::endl; } double area() { return width * height; } }; int main() { std::cout << "Before inner scope" << std::endl; { Rectangle r(4.0, 6.0); std::cout << "Area: " << r.area() << std::endl; } // r's destructor fires HERE, at the closing brace std::cout << "After inner scope" << std::endl; return 0; } Output: Before inner scope Area: 24 Rectangle destroyed After inner scope WHY THIS WORKS AS AN ANSWER ------------------------------ The destructor's message prints exactly at the inner scope's closing brace -- not at the end of main, and not immediately after r.area() is called -- confirming the destructor runs automatically the moment the object goes out of scope, precisely when its lifetime ends, rather than needing any explicit "free" or "destroy" call the way c2-2's own malloc/free discipline required.