Xref: utzoo comp.lang.c:27371 comp.sys.ibm.pc.programmer:660 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!brutus.cs.uiuc.edu!apple!vsi1!octopus!stever From: stever@Octopus.COM (Steve Resnick ) Newsgroups: comp.lang.c,comp.sys.ibm.pc.programmer Subject: Re: TC textcolor(RED) problem Message-ID: <1990Mar30.002905.7523@Octopus.COM> Date: 30 Mar 90 00:29:05 GMT References: <1990Mar28.224220.16285@xenitec.on.ca> Reply-To: stever@octopus.UUCP (Steve Resnick ) Distribution: na Organization: Octopus Enterprises, Cupertino CA Lines: 30 In article <1990Mar28.224220.16285@xenitec.on.ca> timk@xenitec.UUCP (Tim Kuehn) writes: >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 >#include >#include > >main() >{ >textcolor(RED); >printf("hello\n"); >} > I'm not sure how textcolor sets the video attribute, whether it's set in a variable in the conio library or if it actually changes the screen attributes at the same time. Either way, the ANSI driver is oblivious to this change (where printf's out put is going) the correct sequence would be: #include main() { textcolor(RED); cprintf("This oughta work\r\n"); (the \r is needed since this is RAW IO) } Hope this helps....