While in Java, the statement "x = x++;" is well-defined, In every version of C and C++ it is an ERROR, as severe as accessing an array out of bounds, and equally undetectable by some compilers. There is no answer, no correct value, no explanation for C and C++ compiler behavior when encountering this statement. Any guesses of "this evaluates first, and this second" are likely wrong, unless documented explicitly by the compiler vendor (in practice, many compilers interleave register and memory accesses in ways that leave no clear distinction between "first" and "second", if they decide to generate code at all)
I think it helps to show what happens when different real-life compilers encounter your program:
GNU gcc 4.5.1 on linux/x86_64: 1
GNU gcc 3.4.6 on solaris/sparc: 0
Intel C 11.1 on linux/x86_64: 1
CLang 2.9 on linux/x86_64: 0
MS Visual Studio 2010 on Windows XP/x86: 1
Sun C++ 5.8 on solaris/sparc: 0
Sun C 5.8 on solaris/sparc: 1