Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!mips!spool.mu.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: Redirection, Xterms, and Flushing STDIN Message-ID: <1991Mar6.225803.20890@athena.mit.edu> Date: 6 Mar 91 22:58:03 GMT References: Sender: news@athena.mit.edu (News system) Distribution: comp Organization: Massachusetts Institute of Technology Lines: 25 In article , jc@raven.bu.edu (James Cameron) writes: |> printf("\n\nHit to close window: "); |> fflush(stdin); |> fflush(fp); |> ch = getchar(); From the man page fflush(3): Fflush causes any buffered data for the named output stream to be written to that file. The stream remains open. ... These routines return EOF if stream is not associated with an output file, or if buffered data cannot be transferred to that file. Stdin is not an output file. Why are you trying to flush stdin? Perhaps you meant to be flushing stdout? -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710