i want to creat a static instance of class- meaning an object that can be shared by all the other classes, i made
a new field in my class t:
static t* MyInstance;
and a function:
static t* instance()
{
if(MyInstance==NULL)
{
MyInstance=new t();
}
return MyInstance;
}
from the cpp file i created a new instance of the class t:
t::MyInstance=NULL;
but something is wrong because i recieved this error: nresolved external symbol "public: st....
please help!
a new field in my class t:
static t* MyInstance;
and a function:
static t* instance()
{
if(MyInstance==NULL)
{
MyInstance=new t();
}
return MyInstance;
}
from the cpp file i created a new instance of the class t:
t::MyInstance=NULL;
but something is wrong because i recieved this error: nresolved external symbol "public: st....
please help!