Search code examples
ncurses

COLS vs getmaxx in ncurses


Tinkering with ncurses; can't seem to find why I would want to use getmaxyx() instead of LINES and COLS, or vice-versa.

It seems to me that LINES and COLS is already initialized by initscr(), so why would I want to go through the additional step of calling getmaxyx() and setting new variables?


Solution

  • LINES and COLS are the size of the screen, while getmaxyx gives the size of a window. curses applications can have several windows (and rarely more than one screen).