www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/18/00:25:50

From: Joe Wright <conserv3 AT infi DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: printf in DJGPP
Date: Sun, 18 Oct 1998 00:09:43 -0400
Organization: PC Access
Lines: 20
Message-ID: <36296A07.5516@infi.net>
References: <000101bdf9d6$27d61120$764e08c3 AT arthur>
NNTP-Posting-Host: pm7-135.orf.infi.net
Mime-Version: 1.0
X-Mailer: Mozilla 3.03Gold (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Arthur wrote:
> 
> > I am using printf in my programs just to debug my code.  Uno,
> > printf("\n%d",test);  just to see if the value is the right one
> > at run time.
> > And sometimes, for some strange reason, the output turns up after
> > the part of
> > the program that I put it in.
> 
> DJGPP uses buffered output, because it is very slow to do i/o in a virtual
> memory system. This means that the stdout buffer is not output to the screen
> until you force it. This includes a \n, so using printf("\n%d\n",test);
> should work. Otherwise you could use fflush(NULL); which would make printf
> work as expected.
> 
Surely you mean fflush(stdout);, not NULL.
-- 
Joe Wright                                 mailto:conserv3 AT infi DOT net
"Everything should be made as simple as possible, but not simpler."
                    --- Albert Einstein ---

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019