All pastes #453080 Raw Edit

Unnamed

public cpp v1 · immutable
·published 2007-04-22 19:04 UTC
rendered paste body
#include "stdafx.h"#include <iostream>using namespace std;class Singleton {public:	static Singleton* Instance();	static Singleton* ShowError();private:	static Singleton* _instance;};Singleton* Singleton::_instance = 0;Singleton* Singleton::Instance () {	if (_instance == 0) 		_instance = new Singleton;	return _instance;}int main() {		Singleton *data1;	Singleton *data2;	data1->Instance();	data2->Instance();	cout<<endl<<endl;}