OnlineWoerterBuecher.de
Internes

Lexikon


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 (foo(x, y)) { Case 1: printf("Hello ") /* fall through */ Case 2: printf("Goodbye ") break Case 3: printf("Fish ") break default: fprintf(stderr, "Odd foo value ") exit(1) } 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)

In addition suitable Contents:
[ 2 ] [ = ] [ ad ] [ af ] [ ag ] [ al ] [ am ] [ an ] [ ar ] [ arC ] [ as ] [ at ] [ au ] [ b ] [ bloCk ] [ br ] [ branCh ] [ break ] [ break statement ] [ by ] [ C ] [ Ca ] [ Case ] [ Case statement ] [ CC ] [ Ch ] [ Ci ] [ Ck ] [ Co ] [ Code ] [ Com ] [ Comment ] [ Con ] [ Cons ] [ Cu ] [ dd ] [ de ] [ ding ] [ du ] [ eC ] [ ed ] [ er ] [ era ] [ error ] [ es ] [ et ] [ exeC ] [ exeCution ] [ expression ] [ fall through ] [ fault ] [ fi ] [ file ] [ fo ] [ for ] [ Fortran ] [ fprintf ] [ funCtion ] [ funCtional ] [ funCtional language ] [ G ] [ ge ] [ gh ] [ Go ] [ goto ] [ gr ] [ gu ] [ h ] [ hat ] [ high-level language ] [ hole ] [ hr ] [ id ] [ il ] [ in ] [ inC ] [ int ] [ io ] [ ir ] [ is ] [ it ] [ ke ] [ ken ] [ la ] [ language ] [ ld ] [ Lex ] [ li ] [ lt ] [ lu ] [ ma ] [ mil ] [ mm ] [ mo ] [ mod ] [ mode ] [ module ] [ mp ] [ mu ] [ multi-way branCh ] [ na ] [ nC ] [ ne ] [ ng ] [ no ] [ ns ] [ nu ] [ O ] [ om ] [ op ] [ option ] [ pe ] [ ph ] [ pl ] [ pr ] [ printf ] [ program ] [ programming ] [ pt ] [ query ] [ rC ] [ re ] [ relation ] [ ro ] [ ru ] [ S ] [ se ] [ sh ] [ si ] [ so ] [ st ] [ state ] [ stderr ] [ struCt ] [ switCh ] [ T ] [ ] [ tC ] [ td ] [ tf ] [ th ] [ tn ] [ to ] [ tr ] [ ua ] [ ug ] [ us ] [ va ] [ value ] [ ve ] [ ye ]






Go Back ]

Free On-line Dictionary of Computing

Copyright © by OnlineWoerterBuecher.de - (6001 Reads)

All logos and trademarks in this site are property of their respective owner.

Page Generation in 0.0942 Seconds, with 16 Database-Queries
Zurück zur Startseite