How to change console application text color?

Easy! call SetConsoleTextAttribute function with appropriate color codes as follows… [sourcecode language=’cpp’]// A generic function call to set color for text being output void SetColor( const int Color ) { SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ), Color ); } int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { // Only change foreground color SetColor( FOREGROUND_BLUE ); cout
Continue reading…