C++ introductory tutorial — 21C++ class access modifiers

class Base {

Public: // Public members, which are accessible outside the class in the program. Protected: // Protected member variables or functions are very similar to private members, with one difference: protected members are accessible in derived classes. Private: // Private member. Private member variables or functions are not accessible, or even viewable, outside the class. Only classes and friend functions can access private members.

};

// It is enough to remember the above modifiers, which will be discussed in object inheritance.