Microsoft KB Archive/58682

C 6.00/QC 2.50 Support Long/Unsigned Long for Switch or Case PSS ID Number: Q58682 Article last modified on 01-15-1991 PSS database name: S_QuickC

2.50

MS-DOS

Summary:

Microsoft C Version 6.00 and QuickC Version 2.50, in accordance with the ANSI-draft standard, now support both long and unsigned long values in switch expressions and case constants.

Previously, only char and int types were allowed in switch statements.

Code Sample

 * 1) include 

unsigned long SwtchVal = 4L ;

void main(void) { switch( SwtchVal ) case 4L : printf(&quot; SwtchVal = %ld &quot;, SwtchVal ) ; }

Copyright Microsoft Corporation 1991.