OnlineWoerterBuecher.de
Internes

Lexikon


switch statement


(Or case statement, multi-way branch) A construct found in most ef="module.php?name=Lexikon&file=search&eid=1&query=high-level languages">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 ef="module.php?name=Lexikon&file=search&eid=1&query=C">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 ef="module.php?name=Lexikon&file=search&eid=1&query=fall through">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 ef="module.php?name=Lexikon&file=search&eid=1&query=functional languages">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 ef="module.php?name=Lexikon&file=search&eid=1&query=Fortran">Fortran' s ef="module.php?name=Lexikon&file=search&eid=1&query=computed goto">computed goto. (1997-01-30)

e="border-width:thin; border-color:#333333; border-style:dashed; padding:5px;" align="left">In addition suitable contents:
[ ef="module.php?name=Lexikon&op=content&tid=31">2 ] [ ef="module.php?name=Lexikon&op=content&tid=134">= ] [ ef="module.php?name=Lexikon&op=content&tid=262">ad ] [ ef="module.php?name=Lexikon&op=content&tid=383">af ] [ ef="module.php?name=Lexikon&op=content&tid=396">ag ] [ ef="module.php?name=Lexikon&op=content&tid=433">al ] [ ef="module.php?name=Lexikon&op=content&tid=544">am ] [ ef="module.php?name=Lexikon&op=content&tid=592">an ] [ ef="module.php?name=Lexikon&op=content&tid=740">ar ] [ ef="module.php?name=Lexikon&op=content&tid=743">arc ] [ ef="module.php?name=Lexikon&op=content&tid=800">as ] [ ef="module.php?name=Lexikon&op=content&tid=894">at ] [ ef="module.php?name=Lexikon&op=content&tid=935">au ] [ ef="module.php?name=Lexikon&op=content&tid=1026">b ] [ ef="module.php?name=Lexikon&op=content&tid=1402">block ] [ ef="module.php?name=Lexikon&op=content&tid=1535">br ] [ ef="module.php?name=Lexikon&op=content&tid=1550">branch ] [ ef="module.php?name=Lexikon&op=content&tid=1562">break ] [ ef="module.php?name=Lexikon&op=content&tid=1565">break statement ] [ ef="module.php?name=Lexikon&op=content&tid=1695">by ] [ ef="module.php?name=Lexikon&op=content&tid=1708">C ] [ ef="module.php?name=Lexikon&op=content&tid=1724">ca ] [ ef="module.php?name=Lexikon&op=content&tid=1844">case ] [ ef="module.php?name=Lexikon&op=content&tid=1855">case statement ] [ ef="module.php?name=Lexikon&op=content&tid=1896">cc ] [ ef="module.php?name=Lexikon&op=content&tid=2001">ch ] [ ef="module.php?name=Lexikon&op=content&tid=2099">ci ] [ ef="module.php?name=Lexikon&op=content&tid=2136">ck ] [ ef="module.php?name=Lexikon&op=content&tid=2247">co ] [ ef="module.php?name=Lexikon&op=content&tid=2273">code ] [ ef="module.php?name=Lexikon&op=content&tid=2330">com ] [ ef="module.php?name=Lexikon&op=content&tid=2352">comment ] [ ef="module.php?name=Lexikon&op=content&tid=2545">con ] [ ef="module.php?name=Lexikon&op=content&tid=2606">cons ] [ ef="module.php?name=Lexikon&op=content&tid=2900">cu ] [ ef="module.php?name=Lexikon&op=content&tid=3136">dd ] [ ef="module.php?name=Lexikon&op=content&tid=3151">de ] [ ef="module.php?name=Lexikon&op=content&tid=3436">ding ] [ ef="module.php?name=Lexikon&op=content&tid=3752">du ] [ ef="module.php?name=Lexikon&op=content&tid=3865">ec ] [ ef="module.php?name=Lexikon&op=content&tid=3896">ed ] [ ef="module.php?name=Lexikon&op=content&tid=4148">er ] [ ef="module.php?name=Lexikon&op=content&tid=4150">era ] [ ef="module.php?name=Lexikon&op=content&tid=4167">error ] [ ef="module.php?name=Lexikon&op=content&tid=4171">es ] [ ef="module.php?name=Lexikon&op=content&tid=4199">et ] [ ef="module.php?name=Lexikon&op=content&tid=4279">exec ] [ ef="module.php?name=Lexikon&op=content&tid=4286">execution ] [ ef="module.php?name=Lexikon&op=content&tid=4317">expression ] [ ef="module.php?name=Lexikon&op=content&tid=4391">fall through ] [ ef="module.php?name=Lexikon&op=content&tid=4425">fault ] [ ef="module.php?name=Lexikon&op=content&tid=4497">fi ] [ ef="module.php?name=Lexikon&op=content&tid=4520">file ] [ ef="module.php?name=Lexikon&op=content&tid=4700">fo ] [ ef="module.php?name=Lexikon&op=content&tid=4727">for ] [ ef="module.php?name=Lexikon&op=content&tid=4764">Fortran ] [ ef="module.php?name=Lexikon&op=content&tid=4823">fprintf ] [ ef="module.php?name=Lexikon&op=content&tid=4940">function ] [ ef="module.php?name=Lexikon&op=content&tid=4941">functional ] [ ef="module.php?name=Lexikon&op=content&tid=4945">functional language ] [ ef="module.php?name=Lexikon&op=content&tid=4983">G ] [ ef="module.php?name=Lexikon&op=content&tid=5057">ge ] [ ef="module.php?name=Lexikon&op=content&tid=5134">gh ] [ ef="module.php?name=Lexikon&op=content&tid=5236">Go ] [ ef="module.php?name=Lexikon&op=content&tid=5274">goto ] [ ef="module.php?name=Lexikon&op=content&tid=5291">gr ] [ ef="module.php?name=Lexikon&op=content&tid=5403">gu ] [ ef="module.php?name=Lexikon&op=content&tid=5434">h ] [ ef="module.php?name=Lexikon&op=content&tid=5540">hat ] [ ef="module.php?name=Lexikon&op=content&tid=5638">high-level language ] [ ef="module.php?name=Lexikon&op=content&tid=5690">hole ] [ ef="module.php?name=Lexikon&op=content&tid=5768">hr ] [ ef="module.php?name=Lexikon&op=content&tid=5931">id ] [ ef="module.php?name=Lexikon&op=content&tid=6013">il ] [ ef="module.php?name=Lexikon&op=content&tid=6064">in ] [ ef="module.php?name=Lexikon&op=content&tid=6068">inc ] [ ef="module.php?name=Lexikon&op=content&tid=6194">int ] [ ef="module.php?name=Lexikon&op=content&tid=6413">io ] [ ef="module.php?name=Lexikon&op=content&tid=6449">ir ] [ ef="module.php?name=Lexikon&op=content&tid=6482">is ] [ ef="module.php?name=Lexikon&op=content&tid=6558">it ] [ ef="module.php?name=Lexikon&op=content&tid=6789">ke ] [ ef="module.php?name=Lexikon&op=content&tid=6792">ken ] [ ef="module.php?name=Lexikon&op=content&tid=6918">la ] [ ef="module.php?name=Lexikon&op=content&tid=6950">language ] [ ef="module.php?name=Lexikon&op=content&tid=7023">ld ] [ ef="module.php?name=Lexikon&op=content&tid=7091">Lex ] [ ef="module.php?name=Lexikon&op=content&tid=7107">li ] [ ef="module.php?name=Lexikon&op=content&tid=7410">lt ] [ ef="module.php?name=Lexikon&op=content&tid=7415">lu ] [ ef="module.php?name=Lexikon&op=content&tid=7463">ma ] [ ef="module.php?name=Lexikon&op=content&tid=7932">mil ] [ ef="module.php?name=Lexikon&op=content&tid=8019">mm ] [ ef="module.php?name=Lexikon&op=content&tid=8032">mo ] [ ef="module.php?name=Lexikon&op=content&tid=8040">mod ] [ ef="module.php?name=Lexikon&op=content&tid=8046">mode ] [ ef="module.php?name=Lexikon&op=content&tid=8079">module ] [ ef="module.php?name=Lexikon&op=content&tid=8167">mp ] [ ef="module.php?name=Lexikon&op=content&tid=8258">mu ] [ ef="module.php?name=Lexikon&op=content&tid=8330">multi-way branch ] [ ef="module.php?name=Lexikon&op=content&tid=8386">na ] [ ef="module.php?name=Lexikon&op=content&tid=8460">nc ] [ ef="module.php?name=Lexikon&op=content&tid=8472">ne ] [ ef="module.php?name=Lexikon&op=content&tid=8627">ng ] [ ef="module.php?name=Lexikon&op=content&tid=8675">no ] [ ef="module.php?name=Lexikon&op=content&tid=8760">ns ] [ ef="module.php?name=Lexikon&op=content&tid=8787">nu ] [ ef="module.php?name=Lexikon&op=content&tid=8820">O ] [ ef="module.php?name=Lexikon&op=content&tid=8964">om ] [ ef="module.php?name=Lexikon&op=content&tid=9014">op ] [ ef="module.php?name=Lexikon&op=content&tid=9097">option ] [ ef="module.php?name=Lexikon&op=content&tid=9457">pe ] [ ef="module.php?name=Lexikon&op=content&tid=9550">ph ] [ ef="module.php?name=Lexikon&op=content&tid=9651">pl ] [ ef="module.php?name=Lexikon&op=content&tid=9908">pr ] [ ef="module.php?name=Lexikon&op=content&tid=9965">printf ] [ ef="module.php?name=Lexikon&op=content&tid=10023">program ] [ ef="module.php?name=Lexikon&op=content&tid=10042">programming ] [ ef="module.php?name=Lexikon&op=content&tid=10144">pt ] [ ef="module.php?name=Lexikon&op=content&tid=10253">query ] [ ef="module.php?name=Lexikon&op=content&tid=10364">rc ] [ ef="module.php?name=Lexikon&op=content&tid=10385">re ] [ ef="module.php?name=Lexikon&op=content&tid=10508">relation ] [ ef="module.php?name=Lexikon&op=content&tid=10767">ro ] [ ef="module.php?name=Lexikon&op=content&tid=10887">ru ] [ ef="module.php?name=Lexikon&op=content&tid=10918">S ] [ ef="module.php?name=Lexikon&op=content&tid=11150">se ] [ ef="module.php?name=Lexikon&op=content&tid=11314">sh ] [ ef="module.php?name=Lexikon&op=content&tid=11376">si ] [ ef="module.php?name=Lexikon&op=content&tid=11651">so ] [ ef="module.php?name=Lexikon&op=content&tid=11934">st ] [ ef="module.php?name=Lexikon&op=content&tid=11990">state ] [ ef="module.php?name=Lexikon&op=content&tid=12020">stderr ] [ ef="module.php?name=Lexikon&op=content&tid=12109">struct ] [ ef="module.php?name=Lexikon&op=content&tid=12236">switch ] [ ef="module.php?name=Lexikon&op=content&tid=12359">T ] [ ef="module.php?name=Lexikon&op=content&tid=12360"> ] [ ef="module.php?name=Lexikon&op=content&tid=12440">tc ] [ ef="module.php?name=Lexikon&op=content&tid=12463">td ] [ ef="module.php?name=Lexikon&op=content&tid=12578">tf ] [ ef="module.php?name=Lexikon&op=content&tid=12588">th ] [ ef="module.php?name=Lexikon&op=content&tid=12715">tn ] [ ef="module.php?name=Lexikon&op=content&tid=12721">to ] [ ef="module.php?name=Lexikon&op=content&tid=12787">tr ] [ ef="module.php?name=Lexikon&op=content&tid=12986">ua ] [ ef="module.php?name=Lexikon&op=content&tid=13008">ug ] [ ef="module.php?name=Lexikon&op=content&tid=13175">us ] [ ef="module.php?name=Lexikon&op=content&tid=13252">va ] [ ef="module.php?name=Lexikon&op=content&tid=13260">value ] [ ef="module.php?name=Lexikon&op=content&tid=13310">ve ] [ ef="module.php?name=Lexikon&op=content&tid=14042">ye ]






Go Back ]

Free On-line Dictionary of Computing

Copyright © by OnlineWoerterBuecher.de - (6118 Reads)

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

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