A
Army1987
"Undefined behaviour" can be this. You're lucky that yourit works fine for me .my environment is winxp+mingw gcc 3.4.2.
i find the fflush refrence from msdn:
The fflush function flushes a stream. If the file associated with
stream is open for output, fflush writes to that file the contents of
the buffer associated with the stream. If the stream is open for
input, fflush clears the contents of the buffer.
implementation does document it, it doesn't have to (unlike the
case of implementation defined behaviour). But on comp.lang.c not
everybody has the same compiler as yours, so please don't use
things triggering such a behaviour, or post to some other group
where you can expect everybody to be familiar with your
implementation. (If you *really* have to insert some
implementation-specified feature, *and* the question isn't about
it, but about some part of the program with is standard C, try
posting anyway and explicitly say what that feature does. But some
might regard that as off-topic.)