6.5.14 Logical OR operator

Syntax

1

logical-OR-expression:

logical-AND-expression

logical-OR-expression || logical-AND-expression

Constraints

2

Each of the operands shall have scalar type.

Semantics

3

The || operator shall yield 1 if either of its operands compare unequal to 0; otherwise, it yields 0. The result has type int.

4

Unlike the bitwise | operator, the || operator guarantees left-to-right evaluation; there is a sequence point after the evaluation of the first operand. If the first operand compares unequal to 0, the second operand is not evaluated.