

case                        C Keyword                        case




Introduce entry in switch statement


The C keyword case is a label within a switch statement.  For ex-
ample:


        while ((int = getchar()) != EOF)
                switch (foo) {
                        case 'q':
                        case 'Q':
                                exit(0);
                        case ' ':
                                n++;
                        default:
                                break;
                }


case  labels each  of the three  possibilities recognized  by the
switch  statement: a  space, `q', and  `Q'.  The  statements that
follow a  case statement behave  as if they  were enclosed within
braces.

Note that a case statement is  simply a label: it sets a point to
which the  switch statement  jumps, and execution  continues from
that point.  Once a switch statement jumps to the point marked by
a given case label,  execution continues until an exit, break, or
return is  read, or the closing brace of  the switch statement is
encountered.

***** See Also *****

break, C keywords, switch






















COHERENT Lexicon                                           Page 1


