🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2075

Re: is fflush(stdin) conformant???

#2075
From: Larry Jones
Date: Thu, 05 Nov 1992 14:31
21 lines
1491 bytes
In article <MGK.92Nov2131855@cedar.sql.sybase.com>, mgk@sql.sybase.com (Michael Keirnan aka Joe Cool) writes:
> I am not actually comtemplating using this construct. A coworker is
> enrolled in a course where the instructor has advised flushing stdin
> (yes, stdin) in conjunction with using scanf() to "flush the unwanted
> newline."

Is your coworker actually paying money for this "course"?  If so, I'd
advise him to demand an instructor who actually knows something about
the subject.  4.9.5.2 The fflush Function (emphasis mine):

	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*.
----
Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
larry.jones@sdrc.com  or  ...uunet!sdrc!larry.jones
I always send Grandma a thank-you note right away.  ...Ever since she
sent me that empty box with the sarcastic note saying she was just
checking to see if the Postal Service was still working. -- Calvin
Technical Details
Message-ID: <2219@sdrc.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!sdrc!thor!scjones
References: <MGK.92Nov2131855@cedar.sql.sybase.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sdrc!thor!scjones
From: scjones@thor.sdrc.com (Larry Jones)
Newsgroups: comp.std.c
Subject: Re: is fflush(stdin) conformant???
Message-ID: <2219@sdrc.COM>
Date: 5 Nov 92 14:31:33 GMT
References: <MGK.92Nov2131855@cedar.sql.sybase.com>
Sender: news@sdrc.COM
Distribution: comp
Lines: 21