This allows algorithms in the base class to be replaced in the derived class, even if users don't know about the derived class. The latter is accomplished by having the derived class member function call the base class member function, if desired. The compiler uses the static type of the pointer to determine whether the member function invocation is legal. If the type of the pointer can handle the member function, certainly the pointed-to object can handle it as well. E.g., if Vehicle has a certain member function, certainly Car also has that member function since Car is a kind-of Vehicle .
Dynamic binding is a result of virtual functions.
When you may delete a derived object via a base pointer. This is generally A Good Thing. Contents of this web page do not and are not intended to reflect the views of CERFnet . The author of this home page is solely responsible for its contents.