How can I initialize the screen size and screen buffer size each time I run the program?
How can I initialize the screen size and screen buffer size each time I run the program?
That can be done with the usage of SetConsoleScreenBufferSize and SetConsoleWindowInfo when the program starts :
Code:#include <stdio.h> #include <windows.h> int main(void) { HANDLE Output = GetStdHandle(STD_OUTPUT_HANDLE); COORD Coordinates = {200, 100}; SetConsoleScreenBufferSize(Output, Coordinates); SMALL_RECT Coordinates2 = {10, 20, 60, 50}; SetConsoleWindowInfo(Output, TRUE, &Coordinates2); getchar(); return 0; }
I hope that I have helped .