Article View: gnu.g++.bug
Article #1637g++ extensions
From: Doug Schmidt
Date: Sun, 22 Jan 1989 03:42
Date: Sun, 22 Jan 1989 03:42
25 lines
1222 bytes
1222 bytes
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.
Technical Details
Message-ID:
<5045@paris.ics.uci.edu>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!labrea!agate!ucbvax!ucsd!orion.cf.uci.edu!uci-ics!siam.ics.uci.edu!schmidtShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!labrea!agate!ucbvax!ucsd!orion.cf.uci.edu!uci-ics!siam.ics.uci.edu!schmidt From: schmidt@siam.ics.uci.edu (Doug Schmidt) Newsgroups: gnu.g++.bug Subject: g++ extensions Message-ID: <5045@paris.ics.uci.edu> Date: 22 Jan 89 03:42:28 GMT Sender: news@paris.ics.uci.edu Reply-To: Doug Schmidt <schmidt@siam.ics.uci.edu> Organization: University of California, Irvine - Dept of ICS Lines: 25