Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!snorkelwacker!usc!cs.utexas.edu!mailrus!sharkey!dino!cs.iastate.edu!hascall From: hascall@cs.iastate.edu (John Hascall) Newsgroups: comp.lang.c Subject: switch statement Summary: Golly, it looks like ADA :-) Message-ID: <771@dino.cs.iastate.edu> Date: 13 Mar 90 20:14:43 GMT Sender: usenet@dino.cs.iastate.edu Organization: Iowa State Univ. Computation Center Lines: 18 /* If you REALLY hate fall-through on switch statements... */ #define when break;case #define or : case #define otherwise break;default void whatsit(char ch) { switch(ch) { when 'a' or 'e' or 'i' or 'u': printf("it's a vowel\n"); when 'y': printf("it might be a vowel\n"); otherwise: printf("it's not a vowel\n"); } } /* John Hascall / ISU Comp Ctr / hascall@atanasoff.cs.iastate.edu */