I get 12
and 49
from this code
#include <stdio.h>
#define product(a) a*a
int main() {
int i = 3, j, k;
j = product(i++);
k = product(++i);
printf("%d %d\n", j, k);
return 0;
}
If instead of using macro you use a function then you get 9 and 25, which is what I would expect...
Can someone explain why does this happen?