🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Doug Schmidt Sun, 22 Jan 1989 03:42
g++ extensions
#1637
Author: Doug Schmidt
Date: Sun, 22 Jan 1989 03:42
25 lines
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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads