August 2003
Intermediate to advanced
672 pages
16h 23m
English
Conditional operators && and || are similar to their counterpart logical operators & and |, except that their evaluation is short-circuited. Given that x and y represent values of boolean expressions, the conditional operators are defined in Table 3.12. In the table, the operators are listed in decreasing precedence order.
| Conditional AND | x && y | true if both operands are true; otherwise, false. |
| Conditional OR | x || y | true if either or both operands are true; otherwise, false. |
Unlike their logical counterparts & and |, which can also be applied to integral operands for bitwise operations, the conditional operators && and || can only be applied to boolean operands. Their evaluation ...
Read now
Unlock full access