Multi-level inheritance C.

Assuming that a class C inherits from class B, it overrides the virtual function defined in A. C does not override the function. When the pointer of type A* points to an object of type C, Will the function call use the rewritten version in B?
Yes!

Semantically speaking, C implicitly inherits from B Its implementation. Specifically, the implementation of the called virtual function is the most available.

Assuming that a class C inherits from class B, it overrides the definition in A Virtual function. C will not overwrite the function. When the pointer of type A * points to an object of type C, will the function call use the overridden version of B?

Yes!

Semantically speaking, C implicitly inherits its implementation from B. Specifically, the called virtual function The implementation is the most available.

Leave a Comment

Your email address will not be published.