Polymorphism Concept Using C++ Programming Language #programming #polymorphism #concept

preview_player
Показать описание
Polymorphism Concept Using C++ Programming Language #programming #polymorphism #concept
Рекомендации по теме
Комментарии
Автор

This is not polymorphism, you need to add virtual at the beginning of the base class method, and create a pointer of it. That way, you can reimplement the method in the derived classed, and using the base class pointer or reference;

Base * b = new Derived();

you can call the derived class method without knowing what derived object that base class pointer holds.

khaledelgharbi
Автор

you forget to add "virual" in front of Friend::friendsays function and "override" at the end of other friendsays functions

atillakayrak