一个参数问题,问题如下

El Salvador 2019-03-16 08:10:27
bool LocateElem(SqList L,ElemType e,bool(* compare)(ElemType,ElemType)) { ElemType *p; int i; i=1; p=L.elem; while(i<=L.length&&!(* compare)(* p++,e)) ++i; if(i<=L.length) return i; else return 0; return true; } bool Equal(ElemType a,ElemType b) { if(a==b) return true; else return false; } bool Union(SqList A,SqList B,SqList &C) { int i; ElemType elem; C.length=0; for(i=0;i<A.length;i++) C.elem[C.length++]=A.elem[i]; for(i=1;i<=B.length;i++) { elem=B.elem[i-1]; if(!LocateElem(A,elem,Equal))在这里错误 ListInsert(C,C.length+1,elem); } return true; }编译时报出的错误解释: error C2664: 'LocateElem' : cannot convert parameter 3 from 'bool (char,char)' to 'bool (__cdecl *)(char,char)'
...全文
72 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
蓝白云 2019-03-16
  • 打赏
  • 举报
回复
看看是不是这个原因:https://www.cnblogs.com/syru/p/3269524.html
xdn1ce 2019-03-16
  • 打赏
  • 举报
回复
不知道,没用过。百度了一下,我看网上equel的返回类型是个Status

15,440

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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