What happens when base class is publicly inherited by a derived class?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: Cpp LanguageWhat happens when base class is publicly inherited by a derived class?
Chetan Shidling Staff asked 6 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 6 years ago

When base class is publicly inherited by a derived class, the following things happens:

  1. Public members of Base class become ‘public members’ of the derived class.
  2. They are accessible to the objects of the derived class.

Ex: class marks  : public student