On Monday 11 February 2002 01:39 am, you wrote: > From: Bejhan Jetha <nhlstar6@YAHOO.COM> > > >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? > > you mean like > > int whichway(char *dir); > { > switch(dir) > { > case "N": > return 0; > case "NE": > return 1; > case "E": > return 2; > > ::snip:: > > } > return -EError; > } I belive case would compare pointers, and almost certainly not match anything. You'd have to do multiple strcmps in an if-elseif-else construct. -- +---------------------------------------------------------------+ | 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