Fixed Why are these constructs (using ++) undefined behavior? #dev #it #asnwer
Fixed Why are these constructs (using ++) undefined behavior? #dev #it #asnwer
Why are these constructs (using ++) undefined behavior?
int main(int argc, char ** argv) { int i = 0; i = i++ + ++i; printf("%d\n", i); // 3 i = 1; i = (i++); printf("%d\n", i); // 2 Should be 1, no ? volatile int u = 0; u = u++ + ++u; printf("%d\n", u); // 1 u = 1; u = (u++); printf("%d\n", u); // 2 Should also be one, no ? register int v = 0; v = v++ + ++v; printf("%d\n", v); // 3 (Should be…
View On WordPress

















