关于“宏定义”的作用范围
#define x 10(后面不加‘;’):其会在预处理阶段就将程序中出现x的地方全部都替换为10,且不管是在函数外还是函数内
题目:以下代码的输出结果是?
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#define a 10void foo(); main(){ printf("%d..",a); foo(); printf("%d",a);}void foo(){ #undef a #define a 50} |
output: 10..10

浙公网安备 33010602011771号