Summary of complex and fragmented knowledge points (updated from time to time)

Source: Internet
Author: User

 

1. Static nsstring * const

Static:

A. Local static variables: initialization once. Initialization is not performed for the next call.

B. External static variables/functions: used for scope restrictions. They are only used in this file.

C. static data member/member function (C ++): For a class rather than a specific object, for example, counting in a class

Const:

A. Define a const constant: const double Pi = 3.1415

B. Protect the modified items to prevent accidental modification: const int I {I = 1; // an error is reported when the modification is performed}

C. If the const is on the left side of *, it is used to modify the variable pointed to by the pointer, indicating that the pointer is a constant. If the const is on the right side of *, it is used to modify the pointer itself, indicating that the pointer is a constant.

Static nsstring * const:

The pointer content and pointer pointing cannot be changed.

Summary of complex and fragmented knowledge points (updated from time to time)

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.