0
Can you explain how does this code work?
#include <stdio.h> int main() { int a = 2, c=3; a += --c + c++ ; printf("%d %d ", a, c); c += ++a + --a; printf("%d %d", a, c); return 0; }
1 Answer
+ 3
Two words, undefined behaviour
Output vary on the compiler implementation.
It happens when you mix data modification and access in a single execution point. Modern compilers, like one in SoloLearn will warn you this, had the option been enabled.