Preprocessor Directives

You can view the C# compiler as containing a separate preprocessor that processes and prepares the source code for the compiler before the actual compilation takes place. Programmers can use preprocessor directives to mark parts of the source code and thereby instruct the preprocessor to treat these parts in a certain way.

Note

Several of C#'s predecessors, including the C language, contain preprocessors that are separate from the compiler. This is not the case for C# where the preprocessor directives are processed as part of the lexical analysis (this explains the highlighted word view in the first line of this section). ...

Get C# Primer Plus now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.