-
August 16th, 2010, 08:48 AM
#1
Singleton class with static method
Hi
I am trying to implement singleton class having static method.
my requirement is as below:
A.h
Class A{
Public :
Static A* getInstance();
}
B.cpp
#include A.h
Class B : public class A{
A* A::getInstance()
{
//some code.
Return *A
}
}
D.cpp
#include B.h
A* pter = A::getInstance() // error: 'getInstance' is not a member of 'A'
please tell me what is wrong in this code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|