#include <curses.h> extern int COLS;
The external variable COLS indicates the number of columns on the terminal screen.
initscr(3XCURSES)