Новости сайта

gotoxy and clrscr

 
Picture of Юминов Артём
gotoxy and clrscr
by Юминов Артём - Friday, 15 February 2019, 5:31 PM
 
#include <windows.h>

void gotoxy(int x, int y)
{
HANDLE hOut = ::GetStdHandle(STD_OUTPUT_HANDLE);
COORD start = { x, y };
::SetConsoleCursorPosition(hOut, start);
}

void clrscr()
{
HANDLE hOut = ::GetStdHandle(STD_OUTPUT_HANDLE);
COORD start = { 0, 0 };
DWORD writtenChars;
CONSOLE_SCREEN_BUFFER_INFO info;
::GetConsoleScreenBufferInfo(hOut, &info);
::FillConsoleOutputCharacterW(hOut, ' ', info.dwSize.X * info.dwSize.Y, start, &writtenChars);
::SetConsoleCursorPosition(hOut, start);
}
Фото в цвете
Re: gotoxy and clrscr
by Навигатор - Friday, 5 May 2017, 10:20 PM
 
Достаточно архаично