无法从“int”转换为“int”到“int *”
所以我有这些代码行:
int maxY, maxX;
getmaxyx(stdscr, &maxY, &maxX);
它给了我以下错误:
error C2440: '=' : cannot convert from 'int' to 'int *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
每次使用它两次。我什至没有使用 = 运算符!包含curses.h 文件。我做错了什么?
So I have these lines of code:
int maxY, maxX;
getmaxyx(stdscr, &maxY, &maxX);
It gives me the following error:
error C2440: '=' : cannot convert from 'int' to 'int *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
twice for each time I use it. I'm not even using the = operator! The curses.h file is included. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
getmaxyx
是一个宏,它接受的不是 int*,而是 int。它解析为类似
尝试
查看 http://opengroup.org/onlinepubs/007908775/xcurses /getmaxyx.html
getmaxyx
is a macro, which doesn't take int*, but int.It resolves to something like
try
see http://opengroup.org/onlinepubs/007908775/xcurses/getmaxyx.html