Preprocessing commands in C #

Source: Internet
Author: User
In C #, Preprocessor directives is a command that will not be executed and only affects the compilation process.
1. # region and # endregion define a set of statements for overall execution.
2. # define and # UNDEF definition symbols and delete definition symbols
3. # If, # endif, # else and # Elif conditional preprocessing commands (conditional Preprocessor directives)
4. # error and # warning are used to trigger errors and warnings. When an error occurs, the compiler stops the execution. Code . When a warning is issued, the compilation will continue.

1 # Define Symbol1
2 Using System;
3 Public   Class Class1
4 {
5 Public   Static   Void Main ()
6 {
7 # If Symbol1
8 Console. writeline ( " Symbol1 is defined " );
9 # Else
10 # Warning Symbol1 is not defined
11 # Endif
12 }
13 }

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.