schmidt@siam.ics.uci.edu (Doug Schmidt) (01/22/89)
FYI,
While I was browsing through the GNU G++ source code this weekend I
noticed the following useful extension that allows Pascal-like ranges
in the switch statement:
----------------------------------------
main (int argc, char *argv[]) {
switch (argv[1][0]) {
case 'a'..'z' : printf ("lowercase\n"); break;
case 'A'..'Z' : printf ("uppercase\n"); break;
case '0'..'9' : printf ("digit\n"); break;
}
}
----------------------------------------
Enjoy!
Doug
--
schmidt@ics.uci.edu (ARPA) | Per me si va nella citta' dolente.
office: (714) 856-4043 | Per me si va nell'eterno dolore.
| Per me si va tra la perduta gente.
| Lasciate ogni speranza o voi ch'entrate.