CS Electrical And Electronics
@cselectricalandelectronics

What is private inheritance in Cpp?

All QuestionsCategory: Cpp LanguageWhat is private inheritance in Cpp?
CS Electrical And Electronics Staff asked 4 years ago

I need short information.

1 Answers
CS Electrical And Electronics Staff answered 4 years ago

Private Inheritance

Specified between two classes as:

  1. class electrical :  private electronics
  2. class electrical : electronics

Base class Private members

  1. manipulate through inherited member functions
  2. not accessible directly
  3. still inherited

Base class Protected and Public members

  1. becomes private in the derived class

Friend functions not inherited