我的头定义了以下代码:Ç - 前函数参数预期的声明符或“...”
typedef uint8_t EnrollT(uint16_t test1, uint16_t test2);
typedef void ChangeT(uint64_t post1, uint8_t post2);
struct ClusterT * ClientAlloc(EnrollT *, ChangeT *);
我已经实现了这两个功能,并在我的C文件传递那些ClientAlloc()作为如下所示:
ClientAlloc(Enroll, Change);
但是,当我编译源时,弹出错误。
expected declaration specifiers or ‘...’ before ‘enroll’
expected declaration specifiers or ‘...’ before ‘change’
有什么我可能会在这里错过吗?
对于EnrollT
和ChangeT
,我宣布它在我的代码:
uint8_t Enroll(uint16_t test1, uint16_t test2){...};
void Change(uint64_t post1, uint8_t post2){...};
对于ClienAlloc
:
struct ClusterT * ClientAlloc(Enroll, Change){... return something};
你怎么申报'enroll'和'change'? –
删除了我的答案,因为虽然*可能*在某处忘记了分号,但没有人能真正告诉这一小段代码。请显示一个完整的可证实的问题示例。 –
@MichaelWalz和Felix,我已经更新了我的问题。 – user3815726