Possible Duplicate:
FAQ : Undefined Behavior and Sequence Points
Different outputs on different compiler? Is this true that certain statements can generate different outputs on different compilers. I have two compilers handy gcc and msvc expression edition. When I tried a code sample on both of them I was shocked to see different outputs on them.
This was the code sample.
#include<stdio.h>
int main(void)
{
int variable_a = 100;
printf("%d %d", ++variable_a, variable_a++); return 0;
}
Output that I got on gcc was 102 100
On msvc I got 102 101.
Why such a difference?