Jump to content
JBR

C++ Polymorphism explanation questionable

Recommended Posts

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

Share this post


Link to post
Share on other sites

I'm not certain how frequently the staff visits the forum, but I'd say less than once a year. If you find an error on any page you can click the "REPORT ERROR" button at the bottom of that page to send a notice to the site owners.

Share this post


Link to post
Share on other sites
8 hours ago, Ingolme said:

I'm not certain how frequently the staff visits the forum, but I'd say less than once a year.

So that would be never! Or if they have their own mini me devs possibly they would call that a half.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...