In header:
class foo : public ISceneNode
{
public:
foo(){}
void setAge(int a) { age = a; }
int getAge(){ return age; }
private:
int age;
}
In source:
foo::foo()
:ISceneNode(0,0)
{
age = 5;
}
For example, I have this class with a member variable. The member variable is 5. In main:
foo* node = (foo*)smgr->addCubeSceneNode(2);
int age = node->getAge();
It works, however the problem is, program is now unaware of the member variable, since I have not created foo() with new. So, getAge() method returns nothing!
My question is, how do I initialize the member variable?
Thank you.