更新:2007 年 11 月
#undef 使您可以取消符号的定义,以便通过将该符号用作
可以使用
示例
// preprocessor_undef.cs
// compile with: /d:DEBUG
#undef DEBUG
using System;
class MyClass
{
static void Main()
{
#if DEBUG
Console.WriteLine("DEBUG is defined");
#else
Console.WriteLine("DEBUG is not defined");
#endif
}
} | |
DEBUG is not defined | |