case statements
When ANSI strictness is off, CodeWarrior C allows ranges of values in a switch statement by using a special form of case statement. A case statement that uses a range is a shorter way of specifying consecutive case statements that span a range of values. Listing 3.8 shows an example.
The range form of a case statement is
case low ... high :
NOTE
...) from the low and high expressions with spaces.
case statements:switch (i)
{
case 0 ... 2: /* Equivalent to case 0: case 1: case 2: */
j = i * 2;
break;
case 3:
j = i;
break;
default:
j = 0;
break;
}