【发布时间】:2011-07-08 17:01:35
【问题描述】:
我有以下代码:
typedef int (*t_Function) (int x);
t_Function Functions[MAX_FUNCTIONS];
int f(int x)
{
return 0;
}
但我无法正确初始化它。如果我添加以下行:
Functions[0] = f;
然后编译器产生以下错误:
prog.c:217: warning: data definition has no type or storage class
prog.c:217: error: conflicting types for Functions
如何初始化这个函数指针数组?
【问题讨论】:
标签: c arrays function pointers function-pointers