🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #2327

Re: GCC/2 2.2.2

#2327
From: Stephen M. Lacy
Date: Tue, 06 Oct 1992 07:58
31 lines
1445 bytes
Excerpts from netnews.comp.os.os2.programmer: 6-Oct-92 GCC/2 2.2.2 by
Matt Kievit@abcd.Houghto 
> So the output looks like
> 1
> 0
>  
> Enter a number:
> You entered: 1
>  
> Enter a number:
> You entered: 0

The default setting in gcc for streams is to have I/O buffering enabled
(just like UNIX) so, what you'll want to do is put these lines in the
front of your main somewhere:

setbuf(stdin,NULL);
setbuf(stdout,NULL);
setbuf(stderr,NULL);

You don't have to do stderr, but it makes things a little nice if your
print your debugging messages to stderr.  If you don't like this
solution, there is another one: every time you write sometime out, or
want to read something in, use the fflush(stdin) or fflush(stdout)
calls, which should do basically the same thing.  Those get to be a
pain, though.  Hope this helps...

Steve


"When you wake up with me, I'll be your glass of water." -Crowded House
Technical Details
Message-ID: <keoPSB600WB2RBPsoy@andrew.cmu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!sl31+

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!sl31+
From: sl31+@andrew.cmu.edu (Stephen M. Lacy)
Newsgroups: comp.os.os2.programmer
Subject: Re: GCC/2 2.2.2
Message-ID: <keoPSB600WB2RBPsoy@andrew.cmu.edu>
Date: 6 Oct 92 07:58:05 GMT
Article-I.D.: andrew.keoPSB600WB2RBPsoy
Distribution: world
Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
Lines: 31
In-Reply-To: <Matt_Kievit.09mb@abcd.Houghton.MI.US>