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

All QuestionsCategory: Cpp LanguageWhat happens when base class is publicly inherited by a derived class?
Chetan Shidling Staff asked 5 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 5 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