ma(1+a + b) = 1+ a + b * (1+a +b -1) = 1+1+2 * (1+1+2-1); = 8
宏就是简单替换,用 1+a + b 去替换x#define ma(x) x*(x-1)
intmain()
{
int a=1, b=2;
printf("%dn", ma(1+a+b));
return 0;
}结果:
ma(1+a + b) = 1+ a + b * (1+a +b -1) = 1+1+2 * (1+1+2-1); = 8
宏就是简单替换,用 1+a + b 去替换x#define ma(x) x*(x-1)
intmain()
{
int a=1, b=2;
printf("%dn", ma(1+a+b));
return 0;
}结果: