Use marco to define flag variable : Preprocessor Directives « Language Basics « C# / C Sharp
- C# / C Sharp
- Language Basics
- Preprocessor Directives
Use marco to define flag variable
#define DEBUGGING
using System;
class Starter {
#if DEBUGGING
static void OutputLocals() {
Console.WriteLine("debugging...");
}
#endif
static void Main() {
#if DEBUGGING
OutputLocals();
#endif
}
}
Related examples in the same category