delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/16/10:30:14

From: Michiel de Bondt <michielb AT sci DOT kun DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: how to flush cprintf output
Date: Wed, 16 May 2001 16:17:12 +0200
Organization: University of Nijmegen
Lines: 42
Message-ID: <3B028BE8.3BB100AD@sci.kun.nl>
References: <3B024BC5 DOT DE803A4 AT sci DOT kun DOT nl> <9dtm1s$1v2$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: fanth.sci.kun.nl
Mime-Version: 1.0
X-Trace: wnnews.sci.kun.nl 990022633 25260 131.174.132.54 (16 May 2001 14:17:13 GMT)
X-Complaints-To: usenet AT sci DOT kun DOT nl
NNTP-Posting-Date: Wed, 16 May 2001 14:17:13 +0000 (UTC)
X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.7 sun4u)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker wrote:

> Michiel de Bondt <michielb AT sci DOT kun DOT nl> wrote:
> > Hello,
>
> > I did not found this question in the FAQ. I use cprintf some times
> > and then I use printf. But a few times, the printf is done at an old
> > cursor position, i.e. the cursor is there somewhere in the middle of
> > the cprintfs. The cprintfs are not affected, i.e. they are not done
> > from the position after the printf, but from the right position.
>
> > So I wish to know the console variant of fflush (stdout) for standard
> > output.
>
> There is none --- cprintf() isn't buffered, so it doesn't need any
> fflush workalike, to begin with. Instead, you'ld have to be sure you
> fflush(stdout) before any cprintf() or gotoxy() call following a
> printf().
>

This does not agree with observation. Probably, Windows 95 should be
blamed.

>
> The basic problem is that you simply should not mix cprintf() and normal
> printf(), like that. There's no good reason to do so, anyway. If you're
> going to use cprintf(), use it for all output.
>

I wish to print all information to stdout, except the progress asterisks
"*" and search
paths, and the "\b \b" to remove them. The program dvips distinguishes
console output and
standard output as well, i.e. it seems so at least. How can that be? Or
does the program
have undetermined behavior if you do not redirect stdout?

>
> --
> Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
> Even if all the snow were burnt, ashes would remain.

- Raw text -


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