switch (expression)

Steven Ryan smryan at garth.UUCP
Sun Jul 17 08:22:28 AEST 1988


>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.



More information about the Comp.std.c mailing list