Reputation: 85
How I can change the color of the letter in C++, I found that I could change the whole text color via
system("color 01")
but it changes all the text, how I can change the color of one letter/word?
Upvotes: 0
Views: 266
Reputation: 85
Found it:
#include<windows.h>
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(h, FOREGROUND_GREEN | FOREGROUND_INTENSITY);
cout << "TIC TAC TOE GAME";
SetConsoleTextAttribute(h, FOREGROUND_RED | FOREGROUND_INTENSITY);
Upvotes: 1