Let's say I have a parent class A.
class A
{
public:
A() {}
void MyMethod()
{
printf( "A\n" );
}
};
And I have a child class B.
class B : public A
{
public:
B() {}
void MyMethod()
{
printf( "B\n" );
}
};
Now, I would like to require class B to call A::MyMethod(), without explicitly calling it, as shown above. Resulting in:
A
B
Or
B
A
Would that be possible?
Right now B->MyMethod() only calls the child method.