C + + Next day Note January 27, 2016 (Wednesday) p.m.

Source: Internet
Author: User

1. Point P,int R:p (_p) {}Object P P.print ();//code reuse call the print function in point2. Object member variables, which do not appear initialized with the initialization list, the compiler will still automatically invoke the constructor (default construct) in the class that the member variable belongs to to initialize the object member variables. 3. Const:const modifier Functions, only the member functions of the class can be decorated. the value of a member variable cannot be modified in the const member function bodyConst member functions can only be called by the const member function bodyConst objects can only call const member functions4. Destructors:function: Reclaims the resources of an object when the object's life cycle ends. Features: no return value; * cannot be loaded; * cannot be overloaded; * Access rights are publicDestructors are automatically called by the compiler and are called in three ways: The destructor is called when the object's scope ends, the destructor is called when the object is destroyed, and the destructor is called when the delete pointer is to the object. the function name of the destructor begins with a ~ followed by the class name. such as ~circle ().

C + + Next day Note January 27, 2016 (Wednesday) p.m.

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.