#include <stdio.h> double f1(double x) { return xx; } double f2(double x, double y) { return xy; } double fun(double a, double b) { /found/ double (f)(); double r1, r2;//再给函数指针变量赋值是,只需给变量名无需给参数 /found/ f = f1 ; r1 = f(a); /found/ f = f2 ; r2 = (f)(a, b); return r1 + r2; } void main() { double x1=5, x2=3, r; r = fun(x1, x2); printf("\nx1=%f, x2=%f, x1x1+x1x2=%f\n",x1, x2, r); }