请教一个问题
class Demo{
public :void OneFunction(int value)
{
mNum+=value;}
static Demo* Getone(){
if(p==0)
p=new Demo;
return p;}
private:
Demo(int n):mNum(n){}
Demo(const Demo& a){mNum=a.mNum;}
Demo &operator=(const Demo& a)
{mNum=a.mNum;}
private:
int mNum;
static Demo* p;
};
int main()
{
Demo *p=Demo::Getone();
return 0;
}想问下版主,在C++中,定义单件模式时如上面一个类,怎么在VC下就过不去呢