Which C++ function changes text or background color (MS Visual studio)? For example cout<<"This text"; how to make "This text" red color.
Join Stack Overflow to learn, share knowledge, and build your career.
|
|
|||||||||||||||||||||
|
|
Colour isn't a C++ thing, but a property of your terminal. If your terminal speaks ANSI (e.g. any Linux terminal, or DOS or Windows NT if you add
Wikipedia has a list of ANSI escape sequences. |
|||||||||||||||||||||
|
|
You can change the colors for a console application using Win32 and here's an example on how to:
Look at the MSDN documentation for the A more complete example on console applications using Win32 is available here. |
|||||
|
|
I believe that you are looking for the |
||||
|
|