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

  1. Path: sparky!uunet!olivea!spool.mu.edu!agate!doc.ic.ac.uk!uknet!mcsun!Germany.EU.net!rrz.uni-koeln.de!unidui!math.fu-berlin.de!informatik.tu-muenchen.de!hphalle6!behrenss
  2. From: behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens)
  3. Newsgroups: comp.std.c
  4. Subject: Re: is fflush(stdin) conformant???
  5. Message-ID: <behrenss.720947417@hphalle6>
  6. Date: 5 Nov 92 07:10:17 GMT
  7. References: <MGK.92Nov2131855@cedar.sql.sybase.com>
  8. Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
  9. Distribution: comp
  10. Organization: Technische Universitaet Muenchen, Germany
  11. Lines: 26
  12.  
  13. mgk@sql.sybase.com (Michael Keirnan aka Joe Cool) writes:
  14.  
  15. >I am not actually comtemplating using this construct. A coworker is
  16. >enrolled in a course where the instructor has advised flushing stdin
  17. >(yes, stdin) in conjunction with using scanf() to "flush the unwanted
  18. >newline." This seemed rather odd to me, but hey, what do I know?
  19. >So what sayeth the gospel on the subject?
  20.  
  21. It says: The behaviour of fflush() is only defined for output (i.e.
  22. write) streams.
  23. So, any given implementation might work the way your friend uses it,
  24. not work that way, or play the Yankee Doodle :)
  25.  
  26. >The reason I'm interested is that someone teaching a course is
  27. >advocating this usage, and IFF they are incorrect I'd like to set the
  28. >record straight before legions of C-programmers adopt this method.
  29.  
  30. Good idea indeed :) This is somewhat in the same league (sp?) as assuming
  31. the size of any given type, although less annoying :)
  32.  
  33. Soenke
  34. -- 
  35. ===========================================================================
  36. More than silver, more than gold, I need   !    behrenss@informatik.
  37. electricity. I need it for my dreams.      !    tu-muenchen.de
  38. (RACTER)                                   !  FIDO: 2:246/13 Soenke Behrens
  39.