Demonstrate #if, #endif, and #define : Preprocessor Directives : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Preprocessor Directives »

 

Demonstrate #if, #endif, and #define









    

/*
C#: The Complete Reference 
by Herbert Schildt 

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
// Demonstrate #if, #endif, and #define. 
 
#define EXPERIMENTAL 
 
using System; 
 
public class Test1 { 
  public static void Main() { 
     
    #if EXPERIMENTAL 
      Console.WriteLine("Compiled for experimental version."); 
    #endif 
   
    Console.WriteLine("This is in all versions."); 
  } 
}


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Preprocessor Directives