delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/31/06:45:57

From: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: printf
Date: Tue, 31 Mar 1998 13:08:42 +0200
Organization: University of Ghent, Belgium
Lines: 21
Message-ID: <3520CEBA.49EF@rug.ac.be>
References: <351FB59F DOT 3AE29BF9 AT jhu DOT edu> <351FE4ED DOT BEF8C266 AT jhu DOT edu>
NNTP-Posting-Host: eduserv1.rug.ac.be
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Geoff Schoenbaum, MD, PhD wrote:
> Now I'm
> wondering why when I change the text color attribute with
> textcolor(YELLOW), the next printf statement still prints in standard
> off-white.

A hope you didn't anwer this one yourself already :)
textcolor is a conio.h routine. printf is a stdio.h routine. textcolor
alters the way conio.h functions like cprintf write to the screen (the
CONsole). printf on the other hand writes its output to a file which
happens to be stdin (usually "directed" to the screen) and is not
(controllably) affected by color settings.
Solution: either don't use textcolor in combination with printf, or use
cprintf instead.

Hope this helps...

-- 
 \ Vik /-_-_-_-_-_-_/   
  \___/ Heyndrickx /          
   \ /-_-_-_-_-_-_/

- Raw text -


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