This chapter presents the three types of access control in C++ classes. Access controls allow the programmer to declare a class's members as
The situation is similar to personal secrets (shared only with friends), family secrets (shared with friends and children), and nonsecrets (shared with anybody), respectively.
private: member of a class is accessible only by members and friends of the class.
protected: member of a class is accessible by members and friends of the class and by members and friends of derived classes, provided they access the base member via a ...