Re: Multiple Case Values

From: George Greer (
Date: 02/11/02

On Mon, 11 Feb 2002, Bejhan Jetha wrote:

>I know C doesn't support multiple case values but is there another way to
>make it so you can still have two letters without using case values?

There's no way without resorting to dirty tricks like:

#define comb(x,y) ((x) << 8 | (y))
switch (comb(buf[0], buf[1])) {
  case comb('X', 'Y'):

but you can at least get 4 ASCII characters in there using long types.

>PS - George or Alex, want to code for me? :P

We already are.

George Greer

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT