class Grandparent
{
protected:
void DoSomething( int number );
};
class Parent : protected Grandparent
{
};
class Child : Parent
{
void DoSomething()
{
Grandparent::DoSomething( 10 );
Parent::DoSomething( 10 );
}
};
At a minimum, it should look like this. Things are private by default when working with classes, this includes subclasses.
http://codepad.org/xRhc5ig4
There is a complete example of compiling and running.
source
share