S
shan_rish
Hello Group,
Please go through the program below:
RatingComponent.h
=================
class RatingComponent
{
public:
static RatingComponent & getInstance();
protected:
private:
static RatingComponent * _instance;
RatingComponent(); // We're a singleton
};
RatingComponent.cpp
===================
static RatingComponent * RatingComponent::_instance = 0;
RatingComponent & RatingComponent::getInstance()
{
if ( 0 == RatingComponent::_instance )
{
RatingComponent::_instance = new RatingComponent();
}
return *(RatingComponent::_instance);
}
I am getting an error:
Error 566: "RatingComponent.cpp", line 13 # static class member
"RatingComponent *RatingComponent::_instance" may not have
this storage class.
I am using aCC 3.65 compiler from HP. The curious thing is, when i use
older version of aCC 3.55, i am not getting this
error. Any help is greatly apprecited and thanks in advance.
Cheers
Shan
Please go through the program below:
RatingComponent.h
=================
class RatingComponent
{
public:
static RatingComponent & getInstance();
protected:
private:
static RatingComponent * _instance;
RatingComponent(); // We're a singleton
};
RatingComponent.cpp
===================
static RatingComponent * RatingComponent::_instance = 0;
RatingComponent & RatingComponent::getInstance()
{
if ( 0 == RatingComponent::_instance )
{
RatingComponent::_instance = new RatingComponent();
}
return *(RatingComponent::_instance);
}
I am getting an error:
Error 566: "RatingComponent.cpp", line 13 # static class member
"RatingComponent *RatingComponent::_instance" may not have
this storage class.
I am using aCC 3.65 compiler from HP. The curious thing is, when i use
older version of aCC 3.55, i am not getting this
error. Any help is greatly apprecited and thanks in advance.
Cheers
Shan