Hi.
You forgot parentheses in the macro:
Code:
$ cat test.c
#include<stdio.h>
#define boo(x) x/4
main(){
int I;
I=64/boo(4);
printf("%d\n",I);
}
$ cpp test.c
.....
main(){
int I;
I=64/4/4;
printf("%d\n",I);
}
Division is left associative: 64/4/4 = (64/4)/4 = 16/4 = 4. The correct macro would be
Code:
#define boo(x) (x/4)
which gives 64/(4/4) = 64/1 = 64.