Changing background color of a console application?

Changing background color of a console application can be accomplished in two ways… Through console application API’s provided by Microsoft. Through color command in windows. The second one is the easiest, let me show you how to do so… [sourcecode language=”cpp”]// This will change the background to crimson and foreground color to white const int […]
Continue reading…

 

How to clear screen in MS VC?

One option is to use [sourcecode language=’cpp’]system( “cls” );[/sourcecode] Another option is to to use this function. I copied this from MSDN.  😉 [sourcecode language=’cpp’]void cls( HANDLE hConsole ) { /* here’s where we’ll home the cursor */    COORD coordScreen = { 0, 0 };    BOOL bSuccess = FALSE;    DWORD cCharsWritten = 0; /* […]
Continue reading…