int(** x(int (*z)(int,int),int,double))(int);
int(** )(int);
Z x(int(*z)(int,int),int,double)
- x的返回值二级函数指针,参数,有一个函数指针,int,double
- x是一个函数
- z函数指针
int (*p)[5];
int *p[5];
int (*p[5])(int,int);
int ((*p))[5](int,int);
int (* (*p)[5])(int a,int b);
示例
#include<stdio.h>
int add(int a, int b) {
return a + b;
}
int sub(int a, int b) {
return a - b;
}
int mul(int a, int b) {
return a * b;
}
int div(int a, int b) {
return a / b;
}
int main() {
int(*p[4])(int a, int b) = { add,sub,mul,div };
int(**pp)(int, int) = malloc(sizeof(int(*)(int, int)) * 4);
pp[0] = add;
pp[1] = sub;
pp[2] = mul;
pp[3] = div;
for (int i = 0; i < 4; i++) {
printf("\n%d", (*(p + i))(100, 10));
printf("\n%d", pp[i](100, 10));
}
getchar();
return 0;
}