#ifndef __test__Singleton__
#define __test__Singleton__
#include <iostream>
class Singleton{
public:
static Singleton* getInstance();
private:
Singleton();
static Singleton* instance;
};
#endif
#include "Singleton.h"
Singleton::Singleton(){
}
Singleton* Singleton::instance = new Singleton();
Singleton* Singleton::getInstance()
{
return instance;
}
#include <iostream>
#include "Singleton.h"
using namespace std;
int main(int argc, const char * argv[])
{
Singleton* sin=Singleton::getInstance();
return 0;
}