Protected, like public and private, is used to declare the access rights of a member. The members declared by protected are called "protected members", or "protected members" for the short term. From the user's point of view of the class, the
Access permission for C ++ protected members
The discussion on the access permissions of protected in C ++ is already a very old topic, and it is so old that everyone is reluctant to discuss it.
When I read c ++ primer again, the description of
Access permission for C ++ protected membersThe discussion on the access permissions of protected in C ++ is already a very old topic, and it is so old that everyone is reluctant to discuss it.When I read C ++ Primer again, the description of the
Reading Notes Objective c ++ Item 22: declare data members as private, paitiveprivate
First, let's take a look at why data members should not be public. Then we will see that the arguments applied to public data members are also applicable to
We know that in C #, inheritance allows a base class with common data and methods to be widely used to reduce the amount of code, so that derived classes have all members of the base class (except constructors, etc.), and we can naturally use the
A static member is a member of a declared static class. All objects in the class share data. Youyuan is a common function defined outside the class, but it needs to be explained inside the class. In order to distinguish it from the member function
C + + inheritance and derivation concepts, what is inheritance and derivationReusability in C + + is achieved through the mechanism of inheritance (inheritance). Therefore, inheritance is an important part of C + +.
The class is described earlier,
Since the derived class contains the members of the base class and the derived classes themselves, there is a problem with the relationship and access properties of the two-part members. When you build a derived class, you do not simply use the
The two main methods of software development are object-oriented and process-oriented, the focus of the process is mainly on the combination and optimization of instruction, the object-oriented focus is transferred from the instruction to the data
First: Private, public, access to the Protected Access label. Private:Only by 1. The function in the class, 2. Its friend function is accessed. The object of the class cannot be accessed by any other access.protected:can be 1. A function in this
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.