TC textcolor(RED) problem

Tim Kuehn timk at xenitec.on.ca
Thu Mar 29 08:42:20 AEST 1990


This is annoying - I want to display text on my VGA screen in different 
colors. Supposedly the following Turbo C code segment should show me 
a red 'hello' on the screen. It doesn't, but shows me the text in the current 
default color instead:

#include <stdio.h>
#include <conio.h>
#include <dos.h>
 
main()
{
textcolor(RED);
printf("hello\n");
}

-------
I know the computer can do it, becuase the following Turbo PASCAL 
code will show a red 'hello' on the screen like I want:
-------

uses crt, dos;
 
begin
textcolor(RED);
writeln('Hello.');
end.

Am I missing something incredibly obvious, or is this another neat little
"feature" of TC? As near as I can tell, everything is as it's supposed to 
be as a gettextinfo() call returns tinfo.attrib with the proper settings 
that correspond with a color display, and says the text color should be 
red. But the text on the screen isn't red at all.

I'm using an ATI VGA Wonder/512K attached to a NEC 4D on a 386 PC.

Thanks in advance for any assistance!

------------------------------------------------------------------------------
Timothy D. Kuehn 				TDK Consulting Services
871 Victoria St. North, Kitchener, 		voice: (519)-741-3623
Ontario, Canada N2B 3S4			 	DOS/Xenix - SW/HW. uC uP RDBMS
timk at xenitec.on.ca				!watmath!maytag!xenitec!timk
No disclaimer here - I *am* the company!
------------------------------------------------------------------------------



More information about the Comp.lang.c mailing list