what is the difference between protected and private in c++?
The class members declared as private can be accessed only by the functions inside the class. Protected access modifier is similar to that of private access modifiers. ... The class member declared as Protected are inaccessible outside the class but they can be accessed by any subclass(derived class) of that class.