I have three different base classes:
class BaseA { public: virtual int foo() = 0; }; class BaseB { public: virtual int foo() { return 42; } }; clas
It mostly depends on how you called it.
if you did:
class Child : public BaseA { public: int foo() { return 42; } };
and did
BaseA baseA = new Child(); baseA->foo();
It would call Child's foo function.
However, if you did this:
BaseA baseA = new BaseA();
It would produce a compile time error.