Author Topic: Visual C++ - clrscr() function to clear the screen defined here!  (Read 1621 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Here is the Visual C++ version of clrscr function similar to Turbo C that clears your console screen.

Code: (C++)
//Source Code Listing


#include "windows.h"

void clrscr()
{
   DWORD byteswritten = 0;
   COORD ord;
   ord.X = 0;
   ord.Y = 0;
   FillConsoleOutputCharacter(GetStdHandle(STD_OUTPUT_HANDLE), 32, 80 * 25, ord, &byteswritten);
}
« Last Edit: January 11, 2012, 12:56:01 pm by kathir »

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1