CS Electrical And Electronics
@cselectricalandelectronics

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?
CS Electrical And Electronics Staff asked 4 years ago

I need short information.

1 Answers
CS Electrical And Electronics Staff answered 4 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