All pastes #289238 Raw Edit

jfs

public cpp v1 · immutable
#289238 ·published 2006-12-22 23:53 UTC
rendered paste body
#include <stdio.h>class Foo {public:	static int count;	Foo(_TCHAR *place = _T("unknown")) {		_tprintf(_T("Constructing Foo number %d from %s\n"), ++count, place);	}};int Foo::count = 0;Foo staticfoo(_T("static initialiser"));Foo staticfoo2;int _tmain(int argc, _TCHAR* argv[]){	Foo stackfoo(_T("main (on stack)"));	Foo *heapfoo = new Foo(_T("main (on heap"));	delete heapfoo;	return 0;}