Why are these constructs (using ++) undefined behavior in C? #include <stdio.h> int main(void) { int i = 0; i = i++ + ++i; printf("%dn", i); // 3 i = 1; i = (i++); printf("%dn", i); // 2 Should be 1, no ? volatile int u = 0; u = u++ + ++u; printf("%dn", u); // 1 u = 1; u = (u++); printf("%dn", u); // 2 Should also be one, no ? register int v = 0; v = v++ + ++v; printf("%dn", v); // 3 (Should be the same as u ?) int w = 0; printf("%d %d %dn", w++, ++w, w); // shouldn't this print 0 2 2 int x[2] = { 5, 8 }, y = 0; x[y] = y ++; printf("%d %dn", x[0], x[1]); // shouldn't this print 0 8? or 5 0? } Homework? Not trying to be a pain, but you should never write code with expressions like these. They are usually given as academic examples, sometimes showing that different compilers yield different output. ...