根據 C11 標準 §6.5
2 If a side effect on scalar object is unsequenced relative to either
a different side effect on a same scalar object or a value computation
using the value of the same scalar object, the behavior is undefined.
以下數個例子都是未定義的行為
(i = 3) + i;
(i++) + (++i);
(i = 3) + (i = 5);
(i = -1) + (i = -1);
i ^= j ^= i ^= j;
以下是有定義的行為:
i = 3;
i = 5;
(i = 3), (i = 5);
(i = 3) && (i = 5);
(i = 0) || (i = 8);
(i = 1) ? (i = 3) : (i = 5);