C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
switch
                                             Up Contents Index Back
─────C/C++ Language─────────────────────────────────────────────────────────
 
  Keyword:  switch
 
  Syntax:   switch( expression )
             {
                 [case constant-expression:]
                 ∙ ∙ ∙
                    [statement]
                 ∙ ∙ ∙
                 [default :
                    statement]
             }
 
  Summary:   Evaluates <expression> and executes any statement
             associated with <constant-expression> whose value matches
             the initial expression. If there is no match with a
             constant expression, the statement associated with the
             default keyword is executed. If the default keyword is not
             used, control passes to the statement following the switch
             block.
 
  See also:  if, break
                                    -♦-