January 2014
Intermediate to advanced
736 pages
70h 43m
English
The boolean logical AND (&) and boolean logical inclusive OR (|) operators are identical to the && and || operators, except that the & and | operators always evaluate both of their operands (i.e., they do not perform short-circuit evaluation). So, the expression
( gender == 1 ) & ( age >= 65 )
evaluates age >= 65 regardless of whether gender is equal to 1. This is useful if the right operand of the boolean logical AND or boolean logical inclusive OR operator has a required side effect—a modification of a variable’s value. For example, the expression
( birthday == true ) | ( ++age >= 65 )
guarantees that the condition ...
Read now
Unlock full access