delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/18/01:01:23

From: baudy AT total DOT net (Benjamin Audy)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Please Help: Printf problem argv[] issues. LFN?
Date: Sat, 13 Sep 1997 17:47:19 GMT
Message-ID: <341ad0ff.1934630@news.total.net>
References: <5vcnai$s2q AT camel3 DOT mindspring DOT com> <341A17E2 DOT FA8 AT voyageur DOT ca>
NNTP-Posting-Host: 207.139.25.120
Organization: TotalNet Inc.
Lines: 22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Joshua Cannon Butcher wrote:
> 
> Before I write anything I am using RHIDE on Windows 95.
> 
> I am writing a command line DOS utility and use a FOR command for
> several tasks.  While the for command is executing, I am using a
> printf statement to update progress.  This code was taken directly
> from a similar utility I wrote with Borland C++.  the printf in the
> for command DOS NOT update on the screen until the for command is
> finished executing, and all the progress shows up at once.  Why?
> Also, if I use GetCh() in CONIO.H and use printf to print a statement
> before the GetCh(), it does not show the statement (prompt for input
> ifyou will) until after the key is pressed.
> 

Simply turn off line buffering of "stdin" and "stdout":

setbuf (stdin, 0);
setbuf (stdout, 0);

Benjamin Audy
baudy AT total DOT net

- Raw text -


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