Like in Game engines for example in XNA the update function is called automatically again and again. I want to know how i can achieve this in c++.
For ex:
class base
{
void Update();
};
class child1: public base
{
void Update();
}
class child2: public base
{
void Update();
}
void main()
{
base *obBase = new base();
obBase->Update(); /*This should call Update of Child1 and Child2 classes how can I do this*/
}
Just make it virtual:
This will provide polymorphic behavior
And I assume you ment: