Re: scanf behaviour



Richard Heathfield wrote:
Ian Collins said:


Add

fflush( stdin );


No, don't do that. The behaviour of fflush on streams open for input is
undefined.

Oops, so it is.

I've always used the Solaris man page definition:

"If stream points to an input stream or an update stream into
which the most recent operation was input, that stream is
flushed if it is seekable and is not already at end-of-file."

--
Ian Collins.
.



Relevant Pages