All pastes #20623 Raw Edit

Unnamed

public cpp v1 · immutable
#20623 ·published 2005-08-21 11:10 UTC
rendered paste body
#define WINDOWS#ifdef WINDOWS#include <windows.h>void clrscr(void){    COORD                       coordScreen = { 0, 0 };    DWORD                       cCharsWritten;    CONSOLE_SCREEN_BUFFER_INFO  csbi;    DWORD                       dwConSize;    HANDLE                      hConsole = GetStdHandle(STD_OUTPUT_HANDLE);    GetConsoleScreenBufferInfo(hConsole, &csbi);    dwConSize = csbi.dwSize.X * csbi.dwSize.Y;    FillConsoleOutputCharacter(hConsole, TEXT(' '),                               dwConSize, coordScreen, &cCharsWritten);    GetConsoleScreenBufferInfo(hConsole, &csbi);    FillConsoleOutputAttribute(hConsole, csbi.wAttributes,                               dwConSize, coordScreen, &cCharsWritten);    SetConsoleCursorPosition(hConsole, coordScreen);}#elif defined(NIX)#include <curses.h>void clrscr(void){    static int init;    if (init == 0)    {        initscr();        init = 1;    }    clear();    refresh();}#else#error "Unknown Operating System!"#endif