HP C/iX Reference Manual (31506-90011)
82 Chapter5
Expressions
Logical OR Operator
Logical OR Operator
The logical OR operator () performs the logical OR function on its operands.
Syntax
logical-OR-expression
:=
logical-AND-expression
logical-OR-expression
||
logical-AND-expression
Description
Each of the operands must be of scalar type. The type of the left operand need not be
related to the type of the right operand. The result has type int and has a value of 1 if
either of its operands compare unequal to 0, and 0 otherwise. The result is not an lvalue.
The logical OR operator guarantees left-to-right evaluation. If the first operand compares
unequal to 0, the second operand is not evaluated.
Example
var1 || var2