Re: Multiple Case Values

From: George Greer (greerga@circlemud.org)
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
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



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