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