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