例9.3
#definePI3.1415926
#define S(r) PI*r*r
main()
{float a,area;
a=3.6;
area=S(a);
printf("r=%f\narea=%f\n",a,area);
}
运行结果如下:
r=3.600000
area=40.715038
赋值语句area=s(a);经宏展开后为
area=3.1415926*a*a;
#definePI3.1415926
#define S(r) PI*r*r
main()
{float a,area;
a=3.6;
area=S(a);
printf("r=%f\narea=%f\n",a,area);
}
运行结果如下:
r=3.600000
area=40.715038
赋值语句area=s(a);经宏展开后为
area=3.1415926*a*a;