pointer to function in c

Answer:
In the following c code souccer is pointer to function. Pointer soccer can hold the address of such function whose parameters are two double data and return type is also double type data.

#include "math.h"
double (*soccer)(double,double);
void main(){
double d;
soccer=pow;
d=(*soccer)(5.,2.0);
clrscr();
printf("%.2lf",d);
getch();


}

Output: 25.00

No comments: