Use a symbol expression. : Define : Preprocessing Directives C# Examples


C# Examples » Preprocessing Directives » Define »

 

Use a symbol expression.









    
#define  AAA  
#define  BBB  
  
using  System;  
  
class  MainClass  {  
    public  static  void  Main()  {  
          
        #if  AAA  
            Console.WriteLine("Compiled  for  AAA  version.");  
        #endif  
  
        #if  AAA  &&  BBB  
              Console.Error.WriteLine("Testing  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
» Define