c - C 中的函数指针

标签 c gcc function-pointers

以下代码(函数原型(prototype)):

void parse_ini(FSFILE *fp, void(*secFunc)(char*), void(*varFunc)(char*, char*));

编译时出现错误:

util\setup.c:38: error: syntax error before '*' token
util\setup.c:38: error: 'parse_ini' declared as function returning a function
util\setup.c:38: error: syntax error before 'void'
util\setup.c:50: error: syntax error before '*' token

这是什么原因造成的?使用 MPLAB C30,它是用于 PIC24F/dsPIC 16 位微 Controller 的 GCC v3.23 版本。

最佳答案

我猜你没有包含声明/定义 FSFILE 的 header 。

关于c - C 中的函数指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3817323/

相关文章:

c - 移位字符串数组 C

c++ - 将结构体成员函数指针赋值给类函数

c - 分配适当的变量以使这些声明正确

c - C中定义数组类型问题

c - 查找间隔中回文数的算法

c - Scanf 返回意外值

C、Unix 域套接字、辅助数据和 GCC;使用 CMSG_DATA 宏

c - 体系结构 x86_64 MAC GCC 的 undefined symbol

c++ xerces reference没有定义但已定义

c++ - 避免指定包含模板函数指针的冗余模板参数