Mail Archives: djgpp/1996/11/27/03:45:50
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
- Raw text -