Mail Archives: djgpp/1997/09/18/01:01:23
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 -