C/C++ Compiler (cl.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.
C2360
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
     Compiler error C2360
 
     initialization of 'identifier' is skipped by 'case' label
 
     The specified identifier initialization can be skipped in a
     switch statement.
 
     It is illegal to jump past a declaration with an initializer
     unless the declaration is enclosed in a block.
 
     The scope of the initialized variable lasts until the end of the
     switch statement unless it is declared in an enclosed block within
     the switch statement.
 
     The following is an example of this error:
 
          void func( void )
          {
             int x;
             switch ( x )
             {
             case 0 :
                int i = 1;       // error, skipped by case 1
                { int j = 1; }   // OK, initialized in enclosing block
             case 1 :
                int k = 1;       // OK, initialization not skipped
             }
          }
                                    -♦-