Hello! I'm programming this console program and I need some help.
Using MSVC++, how do I color cout output? I tried the conio.h function but it doesn't work, and the Microsoft one doesn't work either. Can anyone help?
Printable View
Hello! I'm programming this console program and I need some help.
Using MSVC++, how do I color cout output? I tried the conio.h function but it doesn't work, and the Microsoft one doesn't work either. Can anyone help?
Hi There,
From what i gather, you can't do it using 'cout'. You have to use the platform specific functions for Windows.
Take a look at SetConsoleTextAttribute(), SetConsoleTitle() and SetConsoleWindowInfo() for info on how to set attributes of a console application. You will have to use the WriteConsole() and ReadConsole() functions to be able to output in colour.
There are a variety of GetConsole* methods too.... you might find them handy!
Good luck!