#include using namespace std; int total = 0; class Test { int id; public: Test() { total++; id = total; cout << "Object " << id << " created" << endl; } ~Test() { cout << "Object " << id << " destroyed" << endl; total--; } }; int main() { cout << "Inside main" << endl; Test t1, t2; { cout << "\nEntering block" << endl; Test t3, t4; cout << "Leaving block" << endl; } cout << "\nBack in main" << endl; Test *p = new Test; delete p; cout << "\nEnd of main" << endl; return 0; }