Mega Code Archive

 
Categories / C# Tutorial / Preprocessing Directives
 

Preprocessing Directives

The #define directive defines a character sequence called a symbol. The existence or nonexistence of a symbol can be determined by #if or #elif The general form for #define: #define symbol #define DEBUGLOG using System; class MainClass {     public static void Main()     {         #if DEBUGLOG         Console.WriteLine("In Main - Debug Enabled");         #else         Console.WriteLine("In Main - No Debug");         #endif     } } In Main - Debug Enabled