May 2002
Beginner
320 pages
6h 18m
English
With complex expressions, you might need to nest parentheses (to put a subexpression inside another subexpression). For example:
4*(3+(6/2))
This complicated expression should be read from the inside out. First, divide 6 by 2. Then add 3 to that result. Then multiply the updated result by 4.
Because C++ doesn't require an expression to be written on a single line, you can make this more understandable by using the parentheses as if they were braces:
4* ( 3+ (6/2) )
This makes it easier to be sure that every opening parenthesis has a closing parenthesis (thus avoiding a common programming mistake).
iostream can display the result of a complex expression just as easily as it can display a simple string ...
Read now
Unlock full access