home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / std / c / 2974 < prev    next >
Encoding:
Internet Message Format  |  1992-11-07  |  1.4 KB

  1. Path: sparky!uunet!sdrc!thor!scjones
  2. From: scjones@thor.sdrc.com (Larry Jones)
  3. Newsgroups: comp.std.c
  4. Subject: Re: is fflush(stdin) conformant???
  5. Message-ID: <2219@sdrc.COM>
  6. Date: 5 Nov 92 14:31:33 GMT
  7. References: <MGK.92Nov2131855@cedar.sql.sybase.com>
  8. Sender: news@sdrc.COM
  9. Distribution: comp
  10. Lines: 21
  11.  
  12. In article <MGK.92Nov2131855@cedar.sql.sybase.com>, mgk@sql.sybase.com (Michael Keirnan aka Joe Cool) writes:
  13. > I am not actually comtemplating using this construct. A coworker is
  14. > enrolled in a course where the instructor has advised flushing stdin
  15. > (yes, stdin) in conjunction with using scanf() to "flush the unwanted
  16. > newline."
  17.  
  18. Is your coworker actually paying money for this "course"?  If so, I'd
  19. advise him to demand an instructor who actually knows something about
  20. the subject.  4.9.5.2 The fflush Function (emphasis mine):
  21.  
  22.     If stream points to an output stream or an update stream in
  23.     which the most recent operation was not input, the fflush
  24.     function causes any unwritten data for that stream to be
  25.     delivered to the host environment to be written to the file;
  26.     *otherwise, the behavior is undefined*.
  27. ----
  28. Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
  29. larry.jones@sdrc.com  or  ...uunet!sdrc!larry.jones
  30. I always send Grandma a thank-you note right away.  ...Ever since she
  31. sent me that empty box with the sarcastic note saying she was just
  32. checking to see if the Postal Service was still working. -- Calvin
  33.