www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/01/16:36:40

Date: Wed, 1 May 1996 16:27:06 -0400 (EDT)
From: Justin Ward <justin AT yoss DOT canweb DOT net>
To: Paul Derbyshire <ao950 AT FreeNet DOT Carleton DOT CA>
cc: djgpp AT delorie DOT com
Subject: Re: Odd printf behaviour
In-Reply-To: <4m3snk$40@freenet-news.carleton.ca>
Message-ID: <Pine.BSF.3.91.960501161840.11190D-100000@yoss.canweb.net>
MIME-Version: 1.0


On 30 Apr 1996, Paul Derbyshire wrote:
> I've seen this myself. Printf buffers things. Use cprintf, if you want to
> avoid the \n and the problems this may cause on the bottom screen line.
> Cprintf also enables colored text and backgrounds. On the other hand the
> text it produces isn't captured by DOS redirection commands, i.e. to
> printer or to a file (I don't think it is anyways...?)

cprintf is CONSOLE printf. it prints to the CONSOLE. the console is always
the screen, not a file, not a device (well actually the console IS a
device). It is usually faster because it writes directly to the screen
rather than to stdout, which is (after being flushed) written to the
screen. cprintf is cool when you are sure you want the text to go to the 
screen, and never anywhere else. BTW you may have to use \r\n instead of 
just \n when using printf (cr/lf rather than just lf).

Justin

- Raw text -


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