Learn C + + citation essays

Source: Internet
Author: User

1. The reference is simply an alias of the referenced variable (object), and it needs to be emphasized that the reference is not a data type and does not occupy storage space.

2. When declaring a reference, remember to initialize it.

3. The reference is initialized and cannot be an alias for another variable (object) (cannot be assigned to another variable).

4. A modification to a reference is a modification to the referenced variable (object), because the reference is an alias of the referenced variable (object).

5. The following situations must be implemented using a reference:

(1) Stream operators << and >>

(2) The return value of the assignment operator =

(3) parameter of copy constructor function

(4) parameter of assignment operator =

Learn C + + citation essays

Related Article

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.