Standard C++ Library Reference ISO/IEC (VERSION3)

An if-else statement executes one of two statements, depending on whether the test-context
expression has a nonzero value:
if (test)
statement-1
else
statement-2
A return statement terminates execution of the function and transfers control to the expression
that called the function. If you write the optional rvalue expression within the return statement,
the result must be assignment-compatible with the type returned by the function. The program
converts the value of the expression to the type returned and returns it as the value of the
function call:
return expression;
An expression that occurs in a side-effects context specifies no value and designates no object
or function. Hence, it can have type void. You typically evaluate such an expression for its side
effects -- any change in the state of the program that occurs when evaluating an expression.
Side effects occur when the program stores a value in an object, accesses a value from an object
of volatile qualified type, or alters the state of a file.
A switch statement jumps to a place within a controlled statement, depending on the value of
an integer expression:
switch (expr)
{
case val-1:
stat-1;
break;
case val-2:
stat-2; falls through to next
default:
stat-n
}
In a test-context expression the value of an expression causes control to flow one way within
the statement if the computed value is nonzero or another way if the computed value is zero.
You can write only an expression that has a scalar rvalue result, because only scalars can be
compared with zero.
A while statement executes a statement zero or more times, while the test-context expression
has a nonzero value:
while (test)
statement
See also the Table of Contents and the Index.