September 1998
Intermediate to advanced
848 pages
20h 13m
English
The keyword for the switch statement is switch.
Program control jumps to the statement bearing the value of expression as a label. Program flow then proceeds through the remaining statements unless redirected again. Both expression and labels must have integer values (type char is included), and the labels must be constants or expressions formed solely from constants. If no label matches the expression value, control goes to the statement labeled default, if present. Otherwise, control passes to the next statement following the switch statement. After control goes to a particular label, all the subsequent statements in the switch are executed until the end of the switch, or a break ...
Read now
Unlock full access