float mul(float x,float y) {return x*y;}
|
float sum(float x,float y) {return x+y;}
|
int main()
|
{float (*ptrmul)(float,float);
|
float (*ptrsum}(float,float);
|
ptrmul=mul;
|
ptrsum=sum;
|
float f1=3.0,f2=9.0,f3;
|
f3=(*ptrmul)(f1,f2)+(*ptrsum)(f1,f2);
|
float(*ptr)(float,float);
|
ptr=sum;
|
printf("sum=%.1f",(*ptr)(f1,f2));
|
ptr=mul;
|
printf("mul=%.1f", (*ptr)(f1,f2));
|
return 0; }
|
|