Of course, if you're just wanting to change the color as you're typing it, then the above is a bit much. A simpler way would be to use this: Help with Code Tags C++ Syntax (Toggle Plain Text) #include <windows.h>#include <iostream.h> int main(){ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0); //replace the 0 with a number for the color you want cout << "Your text here" << endl; return 0;} #include <windows.h> #include <iostream.h> int main() { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0); //replace the 0 with a number for the color you want cout << "Your text here" << endl; return 0; }
#include <windows.h>#include <iostream.h> int main(){ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0); //replace the 0 with a number for the color you want cout << "Your text here" << endl; return 0;}