OnlineWoerterBuecher.de
Internes

Lexikon


switch statement


Ng> (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)

N="left">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 - (6106 Reads)

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

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