Is there a way to output colored text to the console?
I am using Visual Studio 2010, and only need the code to work in Windows.
I have been unsuccessful in finding anything except the windows COLOR command, but that changed the color for the entire screen, and I am looking for something that will change only the part I wish to output.
I've seen it done in Managed C++
E.g.,
{color red}
cout << "Hello ";
{color blue}
cout << "world
";
would yield "Hello world" in red and blue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…