Pre-processor

Source: Internet
Author: User

# The include facility is part of the C ++ pre-processor. The source code of the pre-processor processing program is carried out before the compiler. The preprocessor replaces each # include with the specified header file content.

Regardless of the format in which the header file is saved, it generally contains the class definitions and declarations of variables and functions required for separate compilation.

We must ensure that multiple times containing the same header file will not cause the class and object defined by this header file to be defined multiple times.

The preprocessor variable name must be unique in the program. Any use of names that match the preprocessor variable is associated with the preprocessor variable.

To avoid name conflicts, preprocessor variables are often expressed in uppercase letters.

Preprocessor variables have two states: defined or undefined. The pre-processor variables defined are different from the pre-processor indicators used to detect their statuses.

# Define indicates accepting a name and defining it as a preprocessor variable

# Ifndef indicates whether the specified preprocessor variable is defined. If the preprocessor variable is undefined, all the instructions following it will be processed, knowing that # endif appears.


Pre-processor

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.