There. Easy as that. Make sure to put a clrscr() after you change the color, otherwise there will be no effect. Look through the conio.h library to see all of the colors. There are some light versions of colors as well, so make sure to check the library. Hope that helps.

I am using the free v 5.5 compiler off the Borland website. I do all my colors this way, and it seems to work fine. Then again, I don't do all that in the void clrscr() stuff Paro. And sorry about the missing () after int main...not enough sleep :)

Code:

#include <iostream.h>
#include <conio.h>

int main()
{

textcolor(WHITE);
textbackground(BLACK);
clrscr();

cout<< "\aHello.\n\n";

return(0);
}

If that doesn't work, then I don't know. I have never used either of the compilers you have mentioned, so that might be a reason. Wierd.

Kyoto Oshiro

03-29-2002

Paro

it must be the compiler...cuz it just wont work for me :(

and i thought msvc++ was better than the common freebie!

03-29-2002

ErionD

This has been asked many times. Conio.h is a non-standard header so the ones that have made the compiler has, in your case, probably decided not to take most of its functions.

03-29-2002

Gr3g

Setting color

Above you say things like "LightGrey". Can I use either HEX or RGB to define the colors?