”预处理器定义“使用
1)如图,在项目属性里面的C/C++-->预处理器-->预处理器定义--添加代码ENABLE_Test
2)代码如下就可以刚刚预处理器定义的
#include "stdafx.h"#include <iostream>using namespace std;int _tmain(int argc, _TCHAR* argv[]){#ifdef ENABLE_Test cout<<"ifdef"<<endl;#endifgetchar();return 0;}