c - getmaxyx 如何改变传递变量的值?

标签 c ncurses

#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/

相关文章:

c++ - 如何将 PDCurses 链接到 Windows 上的 C++ 应用程序?

c - ncurses 程序在 PuTTY 以外的任何东西上崩溃

c - 在编译时查看结构体元素的大小?

c - 基于队列文件的持久性 - WebSphere MQ 与 SQLite 队列 (WAL)

vim - 按 <Enter> 在行首给出 "M"

C、ncurses; while 循环中的 if 语句无法正常运行

c - 访问字符串数组时出现奇怪的段错误

c - 为什么代码输出 -1 而不是 1

c - 创建节点数组后,我无法遍历链接列表

python - nodelay() 导致 python curses 程序退出