delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/16/07:00:16

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: how to flush cprintf output
Date: 16 May 2001 10:50:36 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 30
Message-ID: <9dtm1s$1v2$1@nets3.rz.RWTH-Aachen.DE>
References: <3B024BC5 DOT DE803A4 AT sci DOT kun DOT nl>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 990010236 2018 137.226.32.75 (16 May 2001 10:50:36 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 16 May 2001 10:50:36 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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().

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.






-- 
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