Demonstrate #else. : If : Preprocessing Directives C# Examples


C# Examples » Preprocessing Directives » If »

 

Demonstrate #else.









    
#define  AAA  
#define  BBB  
  
using  System;  
  
class  Test  {  
    public  static  void  Main()  {  
          
        #if  AAA  
            Console.WriteLine("Compiled  for  AAA  version.");  
        #else  
            Console.WriteLine("Compiled  for  release.");  
        #endif  
  
        #if  AAA  &&  BBB  
              Console.Error.WriteLine("Testing  AAA  and  BBB  version.");  
        #else  
              Console.Error.WriteLine("Not  (AAA  and  BBB)  version.");  
        #endif  
      
        Console.WriteLine("This  is  in  all  versions.");  
    }  
}
    
   
  
   



Output

Compiled for AAA version.
Testing AAA and BBB version.
This is in all versions.


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Preprocessing Directives
» If