Virtual functions give runtime polymorphism through base pointers or references. A pure virtual function (= 0) makes a class abstract. Beware of object slicing when copying derived objects into base objects.
Loading subject content…
Loading subject content…
Virtual functions give runtime polymorphism through base pointers or references. A pure virtual function (= 0) makes a class abstract. Beware of object slicing when copying derived objects into base objects.