C++ Polymorphism explanation questionable in Critiques Posted October 27, 2019 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
C++ Polymorphism explanation questionable
in Critiques
Posted
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