| |
Demonstrate #else |
|
|
/*
C#: The Complete Reference
by Herbert Schildt
Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/
// Demonstrate #else.
#define EXPERIMENTAL
using System;
public class Test4 {
public static void Main() {
#if EXPERIMENTAL
Console.WriteLine("Compiled for experimental version.");
#else
Console.WriteLine("Compiled for release.");
#endif
#if EXPERIMENTAL && TRIAL
Console.Error.WriteLine("Testing experimental trial version.");
#else
Console.Error.WriteLine("Not experimental trial version.");
#endif
Console.WriteLine("This is in all versions.");
}
}
|
|
|
Related examples in the same category |
|