Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!zardoz.cpd.com!tmiuv0!rick From: rick@tmiuv0.uucp Newsgroups: comp.sys.amiga Subject: Re: program question, stdin, stdout. Message-ID: <4168@tmiuv0.uucp> Date: 9 Aug 90 13:16:37 GMT References: <69@bcstarc.stgt.sub.org> <979@jc3b21.UUCP> Organization: Technology Marketing Inc., Irvine, CA Lines: 20 In article <979@jc3b21.UUCP>, fgd3@jc3b21.UUCP (Fabbian G. Dufoe) writes: > Try adding a call to fflush() after your putchar(). Putchar() outputs to > the stdout buffer, but that doesn't guarantee you the buffer will be > written to the output device. Fflush() flushes the buffers so you know all > output is complete. Very true. One could also use the setvbuf() function to cause stdout to be non-buffered. In most - but not all - cases, this will obviate the need to call fflush(stdout). setvbuf() is defined by ANSI, I believe, the prototype is: int setvbuf(FILE *stream, char *buf, int mode, int size); ---------------------------------------------------------------------------- [- O] Rick Stevens ? EMail: uunet!zardoz!tmiuv0!rick -or- uunet!zardoz!xyclone!sysop V CIS: 75006,1355 (75006.1355@compuserve.com from Internet) "Reality is a crutch for people who can't handle science fiction." ----------------------------------------------------------------------------