/* Note:Your choice is C IDE */ #include "stdio.h" //类函数宏,知识字符替换,没有运算 #define ok(x) x*x #define okk(x) (x)*(x) void main() { int a=2; int b=3; int c = ok(a+b);//相当于a+b*a+b int d = okk(a+b);//相当于(a+b)*(a+b) printf("%d ",c); printf("%d ",d); }
/* Note:Your choice is C IDE */ #include "stdio.h" //类函数宏,知识字符替换,没有运算 #define ok(x) x*x #define okk(x) (x)*(x) void main() { int a=2; int b=3; int c = ok(a+b);//相当于a+b*a+b int d = okk(a+b);//相当于(a+b)*(a+b) printf("%d ",c); printf("%d ",d); }