See example above. This is called static binding . This is called dynamic binding . Some classes represent abstract concepts for which objects cannot exist. If a class is not meant to have any objects, we can make it an abstract class by defining at least one virtual function to be pure by the goofy syntax of assigning 0 to it.
Abstract classes are only useful as bases for other classes.
However, pointers to objects of an abstract class can be created. A virtual function table called the vtable is implemented as an array of function pointers. There may be one vtable for each class, or one grand vtable for all classes. You need the base class to have a virtual destructor . Then when you use the delete operator, the appropriate destructor is called.