>Can you (or Salem) tell me what's wrong using the fflush function because I'd really like to know.
I don't suppose saying that it's bad is good enough? Very well, the fflush function is defined by the ISO C standard as working on output streams. Input streams remain undefined:
Code:
7.9.5.2 The fflush function
Synopsis
#include <stdio.h>
int fflush(FILE *stream);
Description
If stream points to an output stream or an update stream in which the most recent operation
was not input, the fflush function causes any unwritten data for that stream to be delivered to
the host environment to be written to the file; otherwise, the behavior is undefined.
If stream is a null pointer, the fflush function performs this flushing action on all streams
for which the behavior is defined above.
Returns
The fflush function returns EOF if a write error occurs, otherwise zero.
>That's strange, most of the help files I use say you can flush the stdin buffer.
The people who wrote them aren't aware that there's a standard for C. This seems to be a common illness, usually found in the field of teaching and book writing, but certainly not exclusive to those areas.
-Prelude