Date: Thu, 15 Jan 1998 16:34:10 +0100 (MET) From: Olivier Perron To: HackerOC3 Cc: djgpp AT delorie DOT com Subject: Re: parse errors In-Reply-To: <19980115130300.IAA15160@ladder01.news.aol.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 15 Jan 1998, HackerOC3 wrote: > printf("y value?"); > int y; > scanf(" %d", &y); > printf("color value?"); > int c; > scanf(" %d", &c); > > In above code, i get parse errors before int. I also sometimes get parse > errors in function prototypes for seemingly invaild reasons. Please help!! > In C, you have to first define your local variables and only *after* you can write your statements. By the way, the DJGPP port of gcc use buffered IO streams. So, I recommend you to force your printf output with fflush. See the FAQ for further details. Try the following code: int main(void) { int y; int c; printf("y value?"); fflush(stdout); scanf(" %d", &y); printf("color value?"); fflush(stdout); scanf(" %d", &c); exit(0); }