Created
July 14, 2019 08:06
-
-
Save StefanoBelli/e3f79dced1884f403ff28e1038686bae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
void ClearConsole(HANDLE console) { | |
const COORD origin = { 0,0 }; | |
DWORD writtenBytes; | |
DWORD consoleSize; | |
CONSOLE_SCREEN_BUFFER_INFO info; | |
GetConsoleScreenBufferInfo(console, &info); | |
consoleSize = info.dwSize.X * info.dwSize.Y; | |
FillConsoleOutputCharacterA(console, ' ', consoleSize, origin, &writtenBytes); | |
FillConsoleOutputAttribute(console, info.wAttributes, consoleSize, origin, &writtenBytes); | |
SetConsoleCursorPosition(console, origin); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment