0

class derived:protected base ==> int this case all protected and public members of the base class are protected for the derived one

class derived:public base ==> int this case all protected and public members of the base class are respectively protected and public for the derived one

in both cases the derived class can access the public and the protected members of the base class, what's the difference ?

Saif Faidi
  • 509
  • 4
  • 15
  • Have you read [this](https://stackoverflow.com/questions/860339/difference-between-private-public-and-protected-inheritance)? – BobMorane Feb 04 '18 at 16:39

1 Answers1

0

The difference is what other classes can access.

It's a question of what gets exposed as public in the end to other classes, not as much as what gets exposed to derived classes.

Jesper Juhl
  • 30,449
  • 3
  • 47
  • 70