#115 – Using #if, #else, #endif
October 10, 2010 Leave a comment
When using the #if directive to conditionally compile code if a particular symbol is defined, you can also using #else to conditionally compile code if the symbol is not defined.
Here’s an example:
#if LOGGING DoLotsOfLogging(); // To assist in debugging #else DoMinimalLogging(); #endif