Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!gatech!rutgers!mit-eddie!uw-beaver!teknowledge-vaxc!sri-unix!garth!smryan From: smryan@garth.UUCP (Steven Ryan) Newsgroups: comp.std.c Subject: Re: switch (expression) Message-ID: <993@garth.UUCP> Date: 16 Jul 88 22:22:28 GMT References: <1988Jul12.105547.13268@light.uucp> <14036@apple.Apple.COM> Reply-To: smryan@garth.UUCP (Steven Ryan) Organization: INTERGRAPH (APD) -- Palo Alto, CA Lines: 9 >More basic than pointers, how about allowing other arithmetic types in switch >statements? It's really inefficient to do int comparisons when the actual >thing you're CASEing on is a byte. I think that the type of the case labels >should be whatever the type of the switch expression; thus if I say "switch >(foo)" where foo is a char, all the case statements are cast to char. [Not sure, but why not butt in anyway?] I didn't think C had char expressions. I thought every such expression become some kind of int.