1 double add(double x, double y) 2 { 3 return x + y; 4 } 5 6 //double (*Calulate)(double, double);//声明一个函数指针 7 8 9 double Calulate(double x ,double y, double (*Cal)(double, double)) 10 { 11 return Cal(x,y); 12 13 } 14 15 int main() 16 { 17 auto cal = Calulate(1.2,3.4, add); 18 }
标签:return,Calulate,double,Cal,add,加法,操作,函数指针 From: https://www.cnblogs.com/lihongbing1997-1004/p/17085407.html