#include <stdio.h>
class Grandparent
{
protected:
void DoSomething( int number )
{
printf("Grand: %d\n", number);
}
};
class Parent : protected Grandparent
{
protected:
void DoSomething( int number )
{
printf("Parent: %d\n", number);
}
};
class Child : Parent
{
public:
void DoSomething()
{
Grandparent::DoSomething( 10 ); //Now it works
Parent::DoSomething( 10 ); // Now it works.
}
};
int main()
{
Child c;
c.DoSomething();
return 0;
}