www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/18/03:48:19

From: varobert AT colba DOT net
Message-Id: <3.0.32.19990817232132.00793830@mail.colba.net>
X-Sender: varobert AT mail DOT colba DOT net
X-Mailer: Windows Eudora Pro Version 3.0 (32)
Date: Tue, 17 Aug 1999 23:21:37 -0400
To: djgpp AT delorie DOT com
Subject: Re: Error in this? Please reply.
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

At 11:31 PM 8/17/99 GMT, you wrote:
>Hello everybody, I'm running DJGPP v.2 with a bunch of other files and
>the following code gives the following error:
>
>C:\c\modez.c: In function 'main':
>C:\c\modez.c:36: parse error before `for'
>C:\c\modez.c:36: parse error before `)'
>C:\c\modez.c:37: parse error before `)'
>C:\c\modez.c:21: warning: return type of `main' is not `int'
>
>
>---------------------------------------------------------------------------
----------
>
>// MODEZ.C - A demo of mode Z (320x400x256)

[bunch of includes]

>
>void main(int argc, char **argv)
>{
>int index,           // loop variables
>     x, y,
>     color;          // holds the current color
>
>// set the graphics mode to mode Z 320x400x256
>
>Set_Mode_Z();
>
>// fill the screen with dark grey
>
>Fill_Screen_Z(8)
                 ^
You forgot a semicolon here: the line should read
Fill_Screen_Z(8);

>
>// plot 1000 pixels in each of the colors
>
>for (color=1; color<256; color++)
>     for (index=0; index<1000; index++)
>          Write_Pixel_Z(rand()%320,rand()%400,color);
>
>// wipe screen
>
>for (index=320; index>=0; index--)
>     for (y=0; y<400; y++)
>          Write_Pixel_Z(index,y,0);
>
>// restore the video system to text
>
>Set_Graphics_Mode(TEXT_MODE);
>
>} // end main


- GodOfWar
There is always one more bug.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019