the code is
#define PROD(x) x+x
main()
{
int i=3,j;
j=PROD(i+1);
printf("%d", j);
}
pls tell me the output and how it is so?
Macros are quite literally substituted into the code. So you can by
hand rewrite this code to replace PROD with the actual code.
In this case if PROD were defined as
#define PROD(x) x*x
(which would be more logical....) then you will get an interesting
result.
--
Mark McIntyre
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan