| delorie.com/archives/browse.cgi | search |
| From: | brennan AT news DOT rt66 DOT com (Brennan "The Rev. Bas" Underwood) |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: How is switch implemented? |
| Date: | 22 Apr 1997 15:34:07 -0600 |
| Organization: | Acid Brain |
| Lines: | 20 |
| Distribution: | world |
| Message-ID: | <5jjasf$fqr$1@mack.rt66.com> |
| References: | <97Apr14.121115gmt+0100 DOT 21890 AT internet01 DOT amc DOT de> |
| NNTP-Posting-Host: | mack.rt66.com |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
In article <97Apr14.121115gmt+0100 DOT 21890 AT internet01 DOT amc DOT de>,
Chris Croughton <crough45 AT amc DOT de> wrote:
>(Yes, I know C doesn't allow case ranges in switch statements. In my
>opinion it's a serious failure of the language...)
GCC's extended C does! Just do
switch (c) {
case 0 ... 12:
case 47 ... 88:
}
Note the space between the range endpoints and the ellipses.
Brennan
--
brennan AT rt66 DOT com | fsck /u
Riomhchlaraitheoir|
Rasterfarian | <http://brennan.home.ml.org> -O
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |