#include "animal.h" #include "cat.h" #include "dog.h" #include int main() { // because cat and dog are subclasses of animal, they can be stored in an array of animals animal * animals[2] = { new dog("buster"), new cat("mittens") }; for (animal * a : animals) // when calling the make_sound function, the implementation of the actual class gets called (in this case cat or dog) a->make_sound(); }