#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;
}
结果是
宽度:148
高度:38
如何在不传递指针的情况下更改宽度和高度
最佳答案
如果您阅读 https://linux.die.net/man/3/getmaxyx你会看到:
Notes All of these interfaces are macros. A "&" is not necessary before the variables y and x.
关于c - getmaxyx 如何改变传递变量的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64636654/