First of all we need to know that the class of three users are: the class of the implementation of the class of ordinary users and classes of the Inheritors (derived classes), and then explain the differences between the various users.
1, the realization of the class: Gu Mingsi, is the designer of the class, with the maximum permissions, you can access any of the members of the class, mainly responsible for writing the class members and friend code. You can access the public part of the class, which protects the partial (protect) and (private) private parts.
2, ordinary users of the class: is to use the object of the class, this part of the user can only access the interface of the class (that is, the common part Poublic).
3, the successor of the class: is the derived class. Derived classes can access the public and protected parts of the base class, and ordinary users cannot access protected members.
As with other classes, the base class should declare its interface members to be common, while the parts that belong to the implementation are divided into two groups: one for the derived class (protect) and one for the Friend access (private) of the base class and base class. After the above summary, we write and C + + classes, we can well consider the issue of permissions.
In the process of learning C + +, summed up the class of three users and the use of permissions, feel very practical