Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
A base class is a type of class that is used to inherit member variables and methods from.
Or: a base class is the entity that all derived classes share.
The code below shows how an Animal is used as a base class and Cat and Dog are derived classes (of Animal).
#include <iostream> |
A special type of base class is the abstract base class.
All base classes must have a (public) virtual destructor. A non-base class must have a (non-public) non-virtual destructor [1].
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.