这是函数指针数组。一层一层向里面剥就好啦。
是一个指向 返回值为void 参数也是void的指针数组。先看里面[50]知道是个数组,再向外看是一个函数指针,合起来就是函数指针数组。我写个源码,你就明白啦。
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include <stdio.h>//这是你问题中的函数指针数组void (*isr_handle_array[50])(void); //这是两个返回值void 参数也是void的函数void hello(void) { printf ("hello ");}void world(void) { printf("world\n");}int main(){//这里把hello 和world两个函数的地址保存到数组中isr_handle_array[0] = hello;isr_handle_array[1] = world;//这里就可以通过数组直接调用函数啦。isr_handle_array[0]();isr_handle_array[1]();return 0;} |
执行效果如下:
hello world
void (*isr_handle_array[50])(void);求解这个申明怎么理解 啊??
原文:http://www.cnblogs.com/yihujiu/p/5427131.html