Programmer interview book-youyuan Function

Source: Internet
Author: User

The class has the characteristics of encapsulation and Information Hiding. Only the member functions of the class can access the private members of the class,ProgramOther functions in cannot access private members. A non-member function can be a public member of the callback class.

Youyuan is a common function defined outside the class, but it needs to be described in the class. to distinguish it from other member functions, the keyword friend should be added during the description, youyuan is not a member function, but it can be a private member of the member class. youyuan is used to improve the running efficiency of the program, but destroys the encapsulation and hiding of the class, so that non-member functions can also be Private Members of the callback class.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.