Compound Boolean Expressions

As I mentioned earlier, expressions can be compound expressions. Here are some examples of simple and compound expressions. Hopefully, I'll be able to give enough to cover all the types :

(0)
(1)
(x)
(x > y)
((x > y) && (y > z))
((x < y) || (y == z))
(((x < y) || (y == z)) && (a!=b))
(!(a > b))
(!(a >= b) && (c == 0))

Note that every expression and sub-expression is parenthesized. There are compilers out there that don't require all the parenthesis, but I'm pretty sure that g++ does require all of them. The || operator is the logical OR operator. && is logical AND. ! is logical NOT. It is critical to understand the sementics behind these logical operators :

x AND y
-- is true if and only if ''x'' is true and ''y'' is true.
x OR y
-- is true if and only if at least one of ''x'' or ''y'' is true.
NOT x
-- is true if and only if ''x'' is false.