define 的问题
在这里我首先祝各位新年快乐!^-^I want to say that thank you for helping me so much .If without you I don't think I can learn C pass the final exam so easy.So I really thinks.I still need your helps in the futhur.Meanwhile I hope I can help the new comer,though I just learn C one term.
# include <stdio.h>
# define sw(x,y) {x^=y; y^=x; x^=y;}
void main ()
{
int a=10,b=01;
sw (a,b);
printf ("%d,%d\n",a,b);
}
“^”是什么意思。
# include <stdio.h>
# define MIN(x,y) (x)>(y)?(x):(y)
# define T(x,y,r) x*r*y/4
void main ()
{
int a=1,b=3,c=5,s1,s2;
s1=MIN(a=b,b-a);
s2=T(a++,a*++b,a+b+c);
printf ("%s,%d\n",s1,s2);
}
可以写一下过程给我看吗
#define PI 3.14159
#define S(r) PI*(r)*(r)
.....
area=S(a);
这个预处理错在哪