#undef, #elif, and #else preprocessor directives : Macro : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Macro »

 

#undef, #elif, and #else preprocessor directives









    


#define DEBUG
#undef DEBUG
#define PRODUCTION
   
class Test {
  public static void Main() {
    int total = 0;
    int counter = 10;
   
    myLabel:
    System.Console.WriteLine("counter = " + counter);
    if (counter < 5) {
#if DEBUG
      System.Console.WriteLine("goto myLabel");
#elif PRODUCTION
      System.Console.WriteLine("counter < 5");
#else
      System.Console.WriteLine("goto myLabel, counter < 5");
#endif
      goto myLabel;
    }
    System.Console.WriteLine("total = " + total);
  }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Macro