HP 3000 Manuals

Logical OR Operator [ HP C/iX Reference Manual ] MPE/iX 5.0 Documentation


HP C/iX Reference Manual

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



MPE/iX 5.0 Documentation