home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16627 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.7 KB  |  41 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!sdd.hp.com!wupost!darwin.sura.net!sgiblab!munnari.oz.au!cs.mu.OZ.AU!montebello.ecom.unimelb.EDU.AU!carl
  3. From: carl@montebello.ecom.unimelb.EDU.AU (Carl Brewer)
  4. Subject: Re: strange things with gcc
  5. Message-ID: <9232210.1910@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Dept. Engineering Computer Resources, Melbourne Uni.
  8. References: <9232201.24197@mulga.cs.mu.OZ.AU>
  9. Date: Mon, 16 Nov 1992 23:26:24 GMT
  10. Lines: 29
  11.  
  12. In article <9232201.24197@mulga.cs.mu.OZ.AU> carl@montebello.ecom.unimelb.EDU.AU (Carl Brewer) writes:
  13. >I've ahd some funny problems with gcc on SunOS 4.1.2 of late, it doesn't
  14. >seem to handle fflush(stdin) very well (ie not at all).
  15.  
  16. which has been explained, I'm burning the book today !!!
  17.  
  18.  
  19.  wonder if anyone can offer a suggestion as to how to get this little
  20. routine to work.
  21.  
  22. because, if I *don't* do the undefined fflush(stdin) before I try to grab
  23. any input, then the thing doesn't work at all, it just skips itself, somewhere
  24. it is reading in a <cr> from, and the only way I can get it to avoid that,
  25. is to use the evil (non-ansi?) fflush(stdin).  All I want is a simple
  26. pause and wait for <cr>, it *should* be so easy as to be rediculous ...
  27.  
  28. (btw, acc (the Sun ANSI C compiler) does work when fflush(stdin) is used,
  29. but barfs if I don't use it ...
  30.  
  31. maybe there is some other way to clear the buffer from stdin (preferable
  32. without using ioctl) ????
  33.  
  34.  
  35.  
  36. -- 
  37.  Annal  Natrach, Usthvah Spethed,         carl@ecr.mu.oz.au (IRC: Bleve)
  38.  Dochoel Dienve                           carl@munagin.ee.mu.oz.au
  39.                       carl@montebello.ecom.unimelb.EDU.AU
  40.  Merlin, where are you?  Call your dragon, to weave a mist...
  41.