August 2001
Beginner
482 pages
10h 52m
English
Any statement that returns a value is an expression in C++. |
There it is, plain and simple. If it returns a value, it is an expression. All expressions are statements.
The myriad pieces of code that qualify as an expression might surprise you. Here are three examples:
3.2 // returns the value 3.2 PI // float const that returns the value 3.14 SecondsPerMinute // int const that returns 60
Assuming that PI is a const equal to 3.14 and SecondsPerMinute is a constant equal to 60, all three of these statements are expressions.
The complicated expression
x = a + b;
not only adds a and b and assigns the result to x, but yields the value ...
Read now
Unlock full access