CHAPTER 17

image

The Preprocessor

Power tends to corrupt; absolute power corrupts absolutely.

—Lord Acton

The preprocessor in C was historically a separate program that was able to affect code compilation based on the value of flags defined at compile time. Over time, the preprocessor was extended and integrated into the C++ compiler. The designers of C# chose to adopt a subset of the C++ preprocessor, retaining only the conditional compilation commands and rejecting the macro substitution language in order to keep C# code simple.

Preprocessor directives all begin with the # symbol. Modern compilers increase throughput by integrating the preprocessor ...

Get C++ 2013 for C# Developers,Second Edition now with O’Reilly online learning.

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