How does getmaxyx change the value of a passed variable?

Viewed 120
#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

2 Answers

getmaxyx is a macro

#define getmaxyx(win,y,x) (y = getmaxy(win), x = getmaxx(win))
Related