(b == 3) {} // tests if b evaluates to 3 with while (b = 3) {} // b = 3 evaluates to 3, which then casts to true so the loop is infinite See also Action at a distance (computer programming) Don't-care term Sequence point Side-channel attack Undefined behaviour Unspecified behaviour References Computer programming Programming language theory Functional programming Articles with example code