简体   繁体   English

C:当所有类型相同时,用不同的类型重新声明

[英]C: re-declaring with different type when all types are the same

I have a header file that contains this function declaration: 我有一个包含此函数声明的头文件:

bool isAbelianGroup(ConstGroupMemberP IdentityElement, ConstGroupMemberP members[],
                const int membersLen, const binaryOp oper, const freeMember freeMember,
                const GroupComparator compare);

I have ac file in which I implement this function (copy-pasted the prototype from the declaration in the h file) 我有一个实现该功能的ac文件(从h文件中的声明中复制粘贴了原型)

bool isAbelianGroup(ConstGroupMemberP IdentityElement, ConstGroupMemberP members[],
                const int membersLen, const binaryOp oper, const freeMember freeMember,
                const GroupComparator compare){...}

and yet, I get an error for re-declaring with different type: 但是,使用不同的类型重新声明时出现错误:

在此处输入图片说明

Any ideas what might be the problem? 任何想法可能是什么问题?

Found the problem: I should have written const freeMember freeFunc in both h and c files instead of const freeMember freeMember . 发现了问题:我应该在h和c文件中都写const freeMember freeFunc而不是const freeMember freeMember

That was hard to find. 那很难找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM