#include<stdio.h> #define exch(A,B) {int t=A;A=B;B=t;} int main(void) { int a=1,b=4; exch(a,b); printf("%d\t%d\n",a,b); return 0; }
打印:a=4,b=1
a=4,b=1
在输出中,a和b已被交换; 为什么宏不按值调用?请通过解释结果帮助我.
c macros c-preprocessor call-by-value
c ×1
c-preprocessor ×1
call-by-value ×1
macros ×1