KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q42981: Missing Semicolon in GRAPHIC.C

Article: Q42981
Product(s): See article
Version(s): 2.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | docerr | mspl13_c
Last Modified: 2-MAY-1989

On Pages 209 and 210 of "Microsoft QuickC: C For Yourself" is a
listing of the program GRAPHIC.C. In addition to the misspelling
pointed out in README.DOC (i.e., _ERESNOCOLOR spelled incorrectly as
_ERESNOLOR), this program is missing a semicolon after the definition
of modes.

This definition should read as follows:

   int modes[12] =
   {
      _MRES4COLOR, _MRESNOCOLOR, _HRESBW,
      _HERCMONO,
      _MRES16COLOR, _HRES16COLOR, _ERESNOCOLOR, _ERESCOLOR,
      _VRES2COLOR, _VRES16COLOR, _MRES256COLOR, _ORESCOLOR
   };

If this code is compiled without the trailing semicolon, it will
produce the following error:

   error C2062: type 'void' unexpected

This error will occur on the prototype to print_menu as follows:

   void print_menu( void );

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.