From: Douglas Gleichman Newsgroups: comp.os.msdos.djgpp Subject: Re: Ghosts in DJGPP :-) Date: 03 Feb 1997 10:16:48 -0800 Organization: Hughes Aircraft Company Lines: 26 Sender: doug AT X-147-16-128-32 DOT es DOT hac DOT com Message-ID: References: <32F0120D DOT 462C AT cs DOT com> NNTP-Posting-Host: x-147-16-128-32.es.hac.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp "John M. Aldrich" writes: > > Douglas Gleichman wrote: > > > > Or just put > > > > setbuf(stdout, NULL); > > > > at the beginning of main. > > This doesn't always work because DOS sometimes uses its own buffers for > stdout. When? I've never seen this. > fflush() or a newline always works, though. Turbo C/ Microsoft C have buffering turned off by default. DJGPP has it on. The above call to setbuf will make DJGPP operate like those other compilers. If you are porting a program over to DJGPP it seems that it would be a lot easier to add one line than to search for every printf and add a fflush after it.