Question:
How do your change the text color in borland turbo c++ 4.5 in the output window ?
anonymous
2009-02-25 16:17:51 UTC
How do your change the text color in borland turbo c++ 4.5 in the output window ?
Three answers:
Shadow Wolf
2009-02-25 16:51:25 UTC
If you were using a Microsoft compiler, I'd suggest ansi.sys and a pile of ANSI codes. However, there is another route.



If you look in conio.h for Borland compilers as well as DJGPP, you'll find some color functions.



textcolor(int color)

textbackground(int color)



You'll also find an enumeration (enum) for the available colors. Note that not all color combinations are possible.



If you really need the ANSI colors for a Microsoft compiler, I have them from a project I did for a book several years ago. One of the guys that was writing part of the program didn't have a Borland compiler. So I wrote some special ANSI routines to replace the Borland specific stuff. It mostly worked ok though it wasn't as good as the Borland functions.



If you get really bored, you can code interrupt calls and change the colors that way.



Shadow Wolf
anonymous
2016-11-08 02:07:31 UTC
I forget the suited command yet you employ conio.h and undertaking the command settextcolor(a million-15) with each and each quantity (and 0 of course is a quantity yet you ought to settextbackground for it to teach because of the fact it extremely is black) representing one shade on the EGA palette. rapid C++ is previous.
Kasey C
2009-02-25 16:23:08 UTC
You need to use ANSI.SYS to color the output window. Look it up.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...