文章目录
  1. #ifdef 编译时候带参数编译
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifdef TAKE
#define THAT 0

#endif


#ifdef TAKE2
#define THAT 2
#endif


#include<iostream>
using std::cout;
using std::endl;

int main()
{



cout<<THAT<<endl;



}
1
g++ -DTAKE2 ndef.cpp

选择编译TAKE2的宏定义

文章目录