www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/25/14:26:24

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Printing in colour in C
Date: Wed, 25 Mar 1998 10:52:12 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 26
Message-ID: <3519282C.544D@cs.com>
References: <35189BCB DOT 3DA69976 AT mail DOT cth DOT com DOT au>
NNTP-Posting-Host: ppp234.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

colcom wrote:
> 
> Is it possible to print in colour in text mode in C? eg printf or
> something?

There are two ways:

- Install an ANSI.SYS driver or workalike, and print ANSI escape
sequences to format your text, or
- Use the functions in <conio.h> which have been provided for this
purpose.  You can learn about conio functions by typing "info libc func
conio".

Please note that conio functions are not ANSI-standard, and you can run
into problems if you try to use them interchangeably with stdio
functions.  Chapter 9.4 of the FAQ describes some of these problems.

hth

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "History does not record anywhere at |
|       aka Fighteer I       | any time a religion that has any     |
|   mailto:fighteer AT cs DOT com   | rational basis."                     |
| http://www.cs.com/fighteer |                - Lazarus Long        |
---------------------------------------------------------------------

- Raw text -


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