[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CSwitch
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CSwitch
(C) switch
Keywords enabling control over program flow, used in combanation with the case and default keywords.int main() { const int diceThrow = rand()%6; switch(diceThrow) { case 0: print("You threw 1 and lost!"); break; case 5: print("You threw 6 and won!"); break; default: print("You threw something useless!"); break; } return 0; }
- include <stdio.h>
'switch' links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
