// File: bad5.cpp // // Testing where the destructor gets called. // Some things you are not supposed to do. #include #include "dmc.h" using namespace std ; DMC foo() { cout << "Entering foo()\n" ; DMC A ; cout << "Exiting foo()\n" ; return A ; } int main() { cout << "\n\nEntering main()\n" ; DMC Y ; Y = foo() ; cout << "\n\nExiting main()\n" ; }