All pastes #405387 Raw Edit

Miscellany

public cpp v1 · immutable
·published 2007-03-21 18:28 UTC
rendered paste body
#include <iostream>#include <string>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;}