Many of the code samples on the internet are written in Turbo C. The clrscr() function litters these samples, and even to this day people want to wipe your screen. You can use system("CLS"), but that uses a DOS command. DOS commands are with us only at the whim of William the Mighty. Here is the Windows version of clearing the console screen with WinApi functions, in the hope that these functions will stay around a little longer.

// test of the official Windows Console clear the screen function
// tested with Pelles C    vegaseat     26mar2005

#include <stdio.h>

void clrscr(void);

#include <windows.h> 

void clrscr(void)
  COORD coordScreen = { 0, 0 };  // upper left corner
  DWORD cCharsWritten;
  DWORD dwConSize;
  GetConsoleScreenBufferInfo(hCon, &csbi);
  dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
  // fill with spaces
  FillConsoleOutputCharacter(hCon, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
  GetConsoleScreenBufferInfo(hCon, &csbi);
  FillConsoleOutputAttribute(hCon, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
  // cursor to upper left corner
  SetConsoleCursorPosition(hCon, coordScreen);

int main(void)
  int k;
  for(k = 0; k < 25; k++)
  printf("Press Enter...");
  getchar();  // wait  
  return 0;
The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.