请问错在哪里??请高人指点。谢谢

asin 2003-10-16 10:22:28
namespace d3d
{…………
int EnterMsgLoop(bool (*ptr_display)(float timeDelta));
…………
}
///////////////////////////////
int d3d::EnterMsgLoop( bool (*ptr_display)(float timeDelta) )
{}
//////////////////////////////
BOOL Display(float timeDelta)
{}
/////////////////////////////

错误是:error C2664: 'EnterMsgLoop' : cannot convert parameter 1 from 'int (float)' to 'bool (__cdecl *)(float)'
None of the functions with this name in scope match the target type
...全文
42 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
asin 2003-10-16
  • 打赏
  • 举报
回复
TO:daizh:
但是你看我上面的函数:BOOL Display(float timeDelta) 传递的肯定是BOOL。
如果要改的话应该怎么改呢?
daizh 2003-10-16
  • 打赏
  • 举报
回复
在你调用EnterMsgLoop()函数的时候你传给它的参数是int(float)而不是它声明时参数类型
bool (*ptr_display)(float timeDelta),即参数类型不匹配。
asin 2003-10-16
  • 打赏
  • 举报
回复
??不明白。可否说清楚点?我3个函数都给出来了的阿。
liao2001 2003-10-16
  • 打赏
  • 举报
回复
查找你调用这个函数的地方

69,335

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧