Source Code File 05-01_screensize

05-01_screensize.c

#include <ncurses.h>
   
int main()
{
    int x,y;

    initscr();

    getmaxyx(stdscr,y,x);
    printw("Window is %d rows, %d columns.\n",
            y,x);
    refresh();
    getch();

    endwin();
    return(0);
}

Output Screenshot

Notes

* Remember, the second and third arguments for getmaxyx() are not pointers!