Animal a;
Cat c;
Animal* d = new Cat();
Animal e = Cat();

a.getName();
c.getName();
d->getName();
e.getName();

prints:

    Animal
    Cat
    Cat 
    Animal

Categories: