#define add(x) x*x main(){int a=4,b=6,c=7,d=add(a+b)*c;printf("d=%d\n",d);}怎样分析?

来源:学生作业学帮网 编辑:学帮网 时间:2024/07/03 03:13:53

#define add(x) x*x main(){int a=4,b=6,c=7,d=add(a+b)*c;printf("d=%d\n",d);}怎样分析?

#define宏是直接替换,不会先给你计算的
add(a+b) = a+b*a+b
d = add(a+b)*c = a+b*a+b*c =4+4*6+6*7 = 4+24+42 = 70
都是直接替换,不要自己加一些没有的字符.