gotoxy in a console application in windows

gotoxy! what’s that? gotoxy was one of my favorite functions in turbo c++, it moves the input cursor in a console application/MS-DOS application from one location to another. So is there an equivalent function in a windows console application which does the same? Yes, it’s called SetConsoleCursorPosition. Sample code As always with me here is […]
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…