comp.lang.c
[Top] [All Lists]

Re: case labels

Subject: Re: case labels
From: Ben Pfaff
Date: Sat, 29 Mar 2008 13:08:57 -0700
Newsgroups: comp.lang.c

"Bartc" <bc@xxxxxxxxxx> writes:

> OK, let's try:
>
> switch (cmdcode)
> {case 1000..1999: filecmds(); break
>  case 2000..2499: editcmds(); break;
>  case 2500..2999: viewcmds(); break
>  default: misccmds();
>  };

C99 imposes a limit of 1023 case values in a switch statement, so
that switch statement would require at least one more extension
beyond case ranges.
-- 
"Programmers have the right to be ignorant of many details of your code
 and still make reasonable changes."
--Kernighan and Plauger, _Software Tools_

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy