6.5.14 Logical OR operator

Previous Table of Contents "New C Standard" commentary


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

1257 Each of the operands shall have scalar type.

1258 The || operator shall yield 1 if either of its operands compare unequal to 0;

1259 otherwise, it yields 0.

1260 The result has type int.

1261 Unlike the bitwise | operator, the || operator guarantees left-to-right evaluation;

1262 there is a sequence point after the evaluation of the first operand.

1263 If the first operand compares unequal to 0, the second operand is not evaluated.


Created at: 2008-01-30 02:39:43 The text from WG14/N1256 is copyright © ISO