Let's use a more concrete example:
Code:
#include <iostream>
class Base{
public:
void Foo()
{
Fun();
// ...
}
protected:
virtual void Fun()
{
std::cout << "Base::Fun()" << std::endl;
// ...
}
};
class Derived : public Base
{
protected:
virtual void Fun()
{
std::cout << "Derived::Fun()" << std::endl;
// ...
}
};
class FurtherDerived : public Derived
{
protected:
virtual void Fun()
{
std::cout << "FurtherDerived::Fun()" << std::endl;
// ...
}
};
int main()
{
FurtherDerived x;
x.Foo();
}
Suppose that the functions are implemented as you want them to be. What is the expected output?