CodePudding user response:
Multiple inheritance, the name of two parent functionSo either in subclasses override show method, which is either explicitly parent show method, namely the SW. The show () to SW. Car: : show () or to SW. Wagon: : show ()
CodePudding user response:
A virtual function if rewriting the function can cause ambiguity, even if you generated is a derived class, if using a base class pointer is access to the base class, derived class pointer is access to the derived class function, virtual function won't have this problem,