following code snipet:Code:#include <stdio.h> #include <string.h> #include <stdlib.h> #define CUBE(x) (x*x*x) int main(void) { int x, y; x = 5; y = CUBE(++x); printf("y is %d\n", y); }
Ouputs : 392
changing macro to
Code:#define CUBE(x) (x*x)
Ouputs : 49
shouldn't this be 42......
Using VC++ IDE