帮助解决 C++ 中的编译器错误 C2440
当我构建程序时,我收到 C2440 编译器错误,但不知道如何修复它,
这是它出现的行:
if((*Iter)->classID != classID && (*Iter)->getX() == (int)pos.x && (int)(*Iter)->getY == (int)pos.y)
请帮忙!!!
i am getting a C2440 compiler error when i build my program but cant figure out how to fix it
Here is the line it comes up on:
if((*Iter)->classID != classID && (*Iter)->getX() == (int)pos.x && (int)(*Iter)->getY == (int)pos.y)
PLEASE HELP!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您在
getY
调用中缺少()
:(int)(*Iter)->getY
可能应该是(int)(*Iter)->getY()
Looks like you're missing
()
in yourgetY
call:(int)(*Iter)->getY
should probably be(int)(*Iter)->getY()
我猜它的这一部分
(*Iter)->getX() == (int)pos.x
也许它需要是(int)(*Iter)->getX () == (int)pos.x
。这只是基于表达式的(int)(*Iter)->getY == (int)pos.y
部分的盲目猜测。更多的代码/上下文确实会很有帮助。正如 Demian Brecht 指出的那样,也许表达式的这一部分也缺少()
。I guess its this part
(*Iter)->getX() == (int)pos.x
and perhaps it needs to be(int)(*Iter)->getX() == (int)pos.x
. This is just a shot in the dark based on the(int)(*Iter)->getY == (int)pos.y
part of the expression. More code/context would be really helpful though. And as Demian Brecht pointed out, perhaps the()
is missing on this part of the expression as well.