函数声明和赋值问题的数组

CHI*_*HID 2 c pointers

我正在尝试创建一个指向函数的指针数组,并尝试为其分配函数地址.但我得到的错误,我不知道如何继续.

我的代码

void (*Event_Handlers)[3]();  //Line no 10

/* Queue, Drop and Send_back have been defined. for eg */
void Queue()
{
....
}

Event_Handlers[0]=Queue;  // Line 35
Event_Handlers[1]=Drop;   // Line 36
Event_Handlers[2]=Send_Back;   // Line 37
Run Code Online (Sandbox Code Playgroud)

但我收到以下错误

 fsm.c:10: error: declaration of âEvent_Handlersâ as array of functions

 fsm.c:35: warning: data definition has no type or storage class

 fsm.c:35: error: invalid initializer

 fsm.c:36: warning: data definition has no type or storage class

 fsm.c:36: error: invalid initializer

 fsm.c:37: warning: data definition has no type or storage class

 fsm.c:37: error: invalid initializer
Run Code Online (Sandbox Code Playgroud)

哪里出错了

Nem*_*emo 8

你非常接近......

尝试:

void (*Event_Handlers[3])(); 
Run Code Online (Sandbox Code Playgroud)