How can I write colored text to the console with C++? That is, how can I write different text with different colors?
Standard C++ has no notion of 'colors'. So what you are asking depends on the operating system.
For Windows, you can check out the SetConsoleTextAttribute function.
On *nix, you have to use the ANSI escape sequences.