is there a way to change the text colors in the console
is there a way to change the text colors in the console
For a windows machine.......look up the SetConsoleTextAttribute() API function on MSDN....
textcolor(RED); // For Red
textcolor(GREEN); // For Green
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
what do I need to include?
It depends on what your compiler is, I'm not sure about the others, but in dev-cpp it is <conio.c>
Just as Fordy stated...simply include windows.h and use this:
Experiment also FOREGROUND_BLUE, FOREGROUND_GREEN.Code:SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), FOREGROUND_RED );
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers