class Singleton
{
private:
static Singleton s;
int i;
Singleton(int i)
{
this->i = i;
}
void operator= (Singleton s)
{
s.i = this->i;
}
Singleton(Singleton & s)
{
this->i = s.i;
}
public:
static Singleton & getHandle()
{
return s;
}
void setValue(int i)
{
this->i = i;
}
int getValue()
{
return i;
}
};
Singleton Singleton::s(50);
int main()
{
Singleton &s = Singleton::getHandle();
printf("%d\n",s.getValue());
system("pause");
return 0;
}