help me to understand the copest of pointers to function with this following example . i was referring balagurusamy book of 'c' but was unable to understand this concept i also googled but didnt understood the concept
here is the code
#define PI 3.14
double y(double);
double cos(double);
double table (double(*f)(),double,double,double);
main()
{
printf("table of y(x)=2*x*x-x+1\n\n");
table(y,0.0,2.0,0.5);
printf("\ntable of cos(x)\n\n");
table(cos,0.0,PI,0.5);
}
double table(double(*f)(),double min,double max,double step)
{
double a, value;
for(a=min;a<=max;a+=step)
{
value=(*f)(a);
printf("%5.2f %10.4f\n",a,value);
}
}
double y(double x)
{
return(2*x*x-x+1);
}
if u could explain me in detail about the concept of "pointes to function" then it would be really very very helpful