Say we have:
class Base
{
virtual void f() {g();};
virtual void g(){//Do some Base related code;}
};
class Derived : public Base
{
virtual void f(){Base::f();} override;
virtual void g(){/*Do some Derived related code*/} override;
};
int main()
{
Base *pBase = new Derived;
pBase->f();
return 0;
}
Which g()
will be called from Base::f()
? Base::g()
or Derived::g()
?
Thanks...