Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!216.196.98.142.MISMATCH!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 01 Sep 2011 18:33:09 -0500 Message-ID: <4E601637.1BA9@mindspring.com> Date: Thu, 01 Sep 2011 19:33:11 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: fflush References: <4e5fe3b1$0$27973$bbae4d71@news.suddenlink.net> <4E6011E1.292A@mindspring.com> <1bpqjjrggu.fsf@snowball.wb.pfeifferfamily.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 26 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.223.242 X-Trace: sv3-2po/VP1EFrJwvRsZOhzf9AWg+8zUR8ZnjK6ffbQzaoLeSu4IMcEVWrEqqiA8xNQ2hmaaPR5JiZcF7HO!Ap7R+V+2cjBzckWAgP9i7enHMbXn8+EjIS85aWWhgASfRLSSIqTOEqCliqk3fA+MKov4eNBNiaDn!GZXx5eciZk8= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1791 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:9849 Joe Pfeiffer wrote: > > pete writes: > > > Bill Cunningham wrote: > >> > >> Where is the right place to put fflush in a file IO operation? > > > > If you want a message to appear on standard output, > > which asks the user for input, > > then use fflush(stdout) after the message code, > > before the input code. > > > > At least under Linux, > the attempt to read the input causes the output to > be flushed (and I verified that this worked for your code example with > the fflush() snipped). Is this not portable behavior? Portability isn't a boolean quantity. That behavior is not guaranteed though. -- pete