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)'