Pre-Processing Directives

Pre-processing provides the capability to make conditional compilation decisions before a program is compiled. One of the most frequent uses of pre-processing is to create debug versions of code. This lets the same code exist in the same program and support both development and release versions. Another possible use of pre-processing is to support multiple libraries or platform dependencies. The categories of pre-processing directives cover definitions, conditionals, errors, line numbers, and comments.

Define Directive

The define directive allows declaration of the existence of an identifier. These identifiers don't have a value; they either exist or they don't. Using #define makes the value exist:

 #define CLIBUILD ...

Get C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.