int* (*a[5])(int, char*);
带指针返回的函数指针数组
int *
:函数返回值的类型是一个指针变量
(*a[5])
:函数指针名为a,共有5个元素
(int, char*)
:带有两个参数int型参数和char指针型参数
如:
int *fc(int a, char *c)
{
static char cc[0];
cc[0] = c[0] + a;
cc[1] = c[1] + a;
...
...
cc[9] = c[9] + a;
return cc;
}
a[0] = fc; //给指针函数第0个元素赋值
char buf[10] = {0,1,2,3,4,5,6,7,8,9};
a[0](5, buf); //运行指针函数,等于直接运行fc函数