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 - (5968 Reads)

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

Page Generation in 0.1021 Seconds, with 17 Database-Queries
Zurück zur Startseite