#include #include using namespace std; using namespace System; class Test { public: int a, b; ~Test() { delete &a; delete &b; } }; int main () { cout<<"Creating object.\n"; Test *t = new Test; cout<<"Preparing object.\n"; t->a = 1; t->b = 2; cout<<"Printing object: a = " << t->a << " b = " << t->b << "\n"; cout<<"Destroying object at " << t << "\n"; delete t; cout<<"Done."; system("pause"); return 0; }