Found 1 hit - Term: switch statement, Database: *, Strategy: prefix
- [1] : The Free On-line Dictionary of Computing (27 SEP 03)
switch statement
or case statement, multi-way branch a
construct found in most high-level languages for selecting
one of several possible blocks of code or branch destinations
depending on the value of an expression. an example in c is
switch foox, y
case 1: printf"hello\n"; / fall through /
case 2: printf"goodbye\n"; break;
case 3: printf"fish\n"; break;
default: fprintfstderr, "odd foo value\n"; exit1;
the break statements cause execution to continue after the
whole switch statemetnt. the lack of a break statement after
the first case means that execution will fall through into
the second case. since this is a common programming error you
should add a comment if it is intentional.
if none of the explicit cases matches the expression value
then the optional default case is taken.
a similar construct in some functional languages returns the
value of one of several expressions selected according to the
value of the first expression. a distant relation to the
modern switch statement is fortran's computed goto.
1997-01-30
see also:
high-level languages c case 1: printf"hello\n"; / fall through / case 2: printf"goodbye\n"; break; case 3: printf"fish\n"; break; default: fprintfstderr, "odd foo value\n"; exit1; fall through functional languages fortran
computed goto
Results 1 - 10 of 11 found about switch statement: Statement
>> S Words
Statement, definition of term: Statement
statement_pag1.html Switch
>> S Words
Switch, definition of term: Switch
switch_pag1.html Switch Back
>> S Words
Switch Back, definition of term: Switch Back
switch+back_pag1.html Switch Over
>> S Words
Switch Over, definition of term: Switch Over
switch+over_pag1.html Toggle Switch
>> T Words
Toggle Switch, definition of term: Toggle Switch
toggle+switch_pag1.html Selector Switch
>> S Words
Selector Switch, definition of term: Selector Switch
selector+switch_pag1.html Dip Switch
>> D Words
Dip Switch, definition of term: Dip Switch
dip+switch_pag1.html Ignition Switch
>> I Words
Ignition Switch, definition of term: Ignition Switch
ignition+switch_pag1.html Safety Switch
>> S Words
Safety Switch, definition of term: Safety Switch
safety+switch_pag1.html Scram Switch
>> S Words
Scram Switch, definition of term: Scram Switch
scram+switch_pag1.html
Page 1 2 Next Last accessed:2008/07/06 10:39:39 [Total processing time: 1 seconds] |