Size of Terminal window
Hello,
May I ask how may we get the size of terminal window? so we can print the messages in right and left side of window.
after that task just the next message must be printed like that or all next messages also must be like that (left and right side)?
thanks
The classic size of terminal window is 25×80 (lines x columns), but you counting coordinates from 0.
And the whole communication with server (from start to end) must be set like this.
Hope it helps.
Hi, here is one program for calculating the number of rows and columns of your terminal window. Classic size is, like Ondrej said, 25x80, but mine has 30x120 so I hope this will be helpful.
#include <windows.h>
int main(int argc, char *argv[]) {
CONSOLE_SCREEN_BUFFER_INFO csbi;
int columns, rows;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
printf("columns: %d\n", columns);
printf("rows: %d\n", rows);
return 0;
}
Latest Post: TEAMS Our newest member: samaclean Recent Posts Unread Posts Tags
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed