#include <stdio.h>
#include <ncurses.h>
int main() {
initscr();
int height, width;
getmaxyx(stdscr, height, width);
endwin();
printf("width : %i\n", width);
printf("height : %i\n", height);
return 0;
}
result is
width : 148
height : 38
How the width and height were changed without passing a pointer
getmaxyx is a macro
#define getmaxyx(win,y,x) (y = getmaxy(win), x = getmaxx(win))