定义和使用
#include <stdio.h>
#include <math.h>
int main()
{
double (*p) (double , double);
p = pow;
printf("%.5f", p(2, 5));
return 0;
}
使用( 指向函数的指针 )的函数
#include <stdio.h>
#include <math.h>
void op_ar(double *beg, double *end, double (*fp) (double, double))
{
for(; beg <= end; beg++)
printf("%.0f\t%.0f\n", *beg, fp(*beg, 3));
}
int main()
{
double a[] = {1,2,3,4,5,6,7,8,9,10};
double (*fp) (double , double);
fp = pow;
op_ar(a+2, a+9, fp);
return 0;
}