How to check ymax and xmax in a console window, under Windows, using plain c?
There is this piece of code for linux:
(Partial answer)
This code:
CONSOLE_SCREEN_BUFFER_INFO csbi;
int ret;
ret = GetConsoleScreenBufferInfo(GetStdHandle( STD_OUTPUT_HANDLE ),&csbi);
if(ret)
{
printf("Console Buffer Width: %d\n", csbi.dwSize.X);
printf("Console Buffer Height: %d\n", csbi.dwSize.Y);
}
Gives the size of the buffer. The only problem is that dwSize.Y is not really the size of the screen (300 here instead of 25 lines). But dwSize.X matches the column's number. Needs only windows.h to work.