Mail Archives: djgpp/1999/08/10/15:47:11
Dan Gold wrote:
>
> I don't know how to detect if more than one truth statement with a switch
> could someone tell me.
> I want to do something like
>
> switch (ch) {
>
> case 'e' && 'a':
>
> or is it something like
>
> case 'e': no break...
> case 'a': code....
The latter. One normally writes something like:
switch (c) {
case 'e':
case 'a':
/* code... */
break;
};
The first case would compile, but would be equivalent to `case 1:',
since the constants 'e' and 'a' are both nonzero.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -