Message-Id: Date: 27 Nov 96 10:53 IST From: tehmul%NIITPUN AT iris DOT ernet DOT in Sender: tehmul%niitpun AT iris DOT ernet DOT in To: djgpp AT delorie DOT com Subject: Re: flushing buffers Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit J. Lee wrote: > ... > My problem is as follows. > ... > Before i get an input from the keyboard using any of the stdio functions > (ex. scanf, getchar(),gets etc.), i always flush out the buffer using > fflush(stdin). However, the buffer is never flushed out. On my next > getchar() statement, for example, the remaining characters in the buffer > are retrieved instead of waiting for new input. The fflush(stdin) work > fine when i am using UNIX. How can i solve this very frustrating > problem in DJGPP? I had the same problem. ANSI doesn't define fflush on input streams which is why the fflush didn't work. Use rewind( stdin ) instead of fflush( stdin ). That ought to cure your woes. Ciao. TG