填空题
下面程序由两个源程序文件:t4.h和t4.c组成,程序编译运行的结果是: 1。
t4.h的源程序为:
#define N 10
#define f2(x) (X*N)
t4.c的源程序为:
#include
#define M 8
#define f(x) ((x)*M)
#include "t4.h"
main2
{int i,j;
i=f(1+1);j=t2(1+1);
printf("%d%d\n",i,J);
}
【正确答案】
1、16 11
【答案解析】宏替换的运算规则,结合本题,我们可以得到f((1+1)*M)=fun((1+1)*8=16;f2(1+1)=l+1,l*n=1+1*10=11。