Polymorphism
Polymorphism comes from two words: Poly which means many and Morph which means form. Polymorphism as a word simply means ma...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
This is wrong. It won't even compile. You must use mem-initialization as you did in your previous example to initialize base classes. You should use it for data members otherwise you pointlessly default initialize members first only to assign them immediately afterwards. So the code is very much not the same.
And you should be passing
stringbyconst&otherwise you make pointless copies of the string.Yeah
I just realized. I will make the correction right now. Thank you😊