-
break
statement
Kernighan p224 (very bottom of page)
A break
statement may appear only in an iteration statement
or a switch
statement, and terminates execution of the
smallest enclosing such statement; control passes to the statement
following the terminating statement.
-
switch (
expression )
statement
- expression must be integral.
- all case constants must be unique.
- all sub-statements must be labeled with one
or more
case
labels.
- Only one
default
statement is allowed.
- If there is no break, execution continues
into the next
case
.
- Has the possibility of providing a very fast
multi-way jump.
switch( i )
{
case 1: a++; /* falls into case 2 */
case 2: b++; break;
default: c++; /* I was not 1 or 2 */
}
-
continue
statement
Kernighan p224
A continue
statement may appear only within
an iteration statement. It causes control to pass to the
loop-continuation portion of the
smallest enclosing such statement.
Instructor: ltaber@pima.edu ** My new Home at GeoApps in Tucson ** The Pima College Site
| | | 5.12 "C" Language Constructs -- 3 |