Hi,
I've been teaching C++ and OO for 20 years and stumbled over this:
https://www.w3schools.com/cpp/cpp_polymorphism.asp
Where is the polymorphism?
My second line is a polymorphic call.
Animal *pAnimal = new Pig();
pAnimal->animalSound();
IMO your code is misleading and not useful.
Please contact me to discuss.
John