#include<iostream.h> #include<conio.h> class x { public: x() { cout<<"constructor called"; } void show() { cout<<"Show() called"; } ~x() { cout<<"Destructor called"; } }; int main() { x o; o.show(); getch(); return 0; }
int main(){ { x o; o.show(); } // <-- destructor called getch(); return 0;}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)