| 单词 |
switch statement |
| 释义 |
switch statement
switch statement (programming)(Or case statement, multi-way branch) Aconstruct found in most high-level languages for selectingone of several possible blocks of code or branch destinationsdepending on the value of an expression. An example in C is
switch (foo(x, y))case 1: printf
The break statements cause execution to continue after thewhole switch statemetnt. The lack of a break statement afterthe first case means that execution will fall through intothe second case. Since this is a common programming error youshould add a comment if it is intentional.
If none of the explicit cases matches the expression valuethen the (optional) default case is taken.
A similar construct in some functional languages returns thevalue of one of several expressions selected according to thevalue of the first expression. A distant relation to themodern switch statement is Fortran's computed goto. |
| 随便看 |
- heidelberg, university of
- heidelberg unix sequence analysis resources
- heidelburg
- heidell, pittoni, murphy & bach, llp
- heiden
- heidenau
- heidenau (sachsen)
- heidenau (saxony)
- heidenberg
- heiden eric
- heiden, eric
- heidenhain
- heidenhain, adolf
- heidenhain azan stain
- heidenhain crescents
- heidenhain demilunes
- heidenhain iron hematoxylin stain
- heidenhain law
- heidenhain, martin
- heidenhain modification of mallory-azan stain
- heidenhain pouch
- heidenhain, rudolf peter heinrich
- heidenhain, rudolph p
- heidenhain, rudolph p.
- heidenhain syndrome
|