6.8.4 Selection statements

Syntax

1

selection-statement:

if ( expression ) statement

if ( expression ) statement else statement

switch ( expression ) statement

Semantics

2

A selection statement selects among a set of statements depending on the value of a controlling expression.

3

A selection statement is a block whose scope is a strict subset of the scope of its enclosing block. Each associated substatement is also a block whose scope is a strict subset of the scope of the selection statement.