#include<math.h>
#include<stdio.h>

struct function {double (*f)(double,void*); void* params;};
void tabulate(struct function f, double a, double b, double dx);

struct abc {double a,b,c;};
double parabola(double x, void* params){
  struct abc p = *(struct abc *)params;
  return p.a + p.b*x + p.c*x*x;
}


int main(){
	double x1=0,dx=0.1,x2=2;
	struct function foo;
	struct abc p;
	foo.f=&parabola;
	foo.params=&p;
	p.a=1;p.b=0;p.c=0; tabulate(foo,x1,x2,dx); printf("\n");
	p.a=0;p.b=1;p.c=0; tabulate(foo,x1,x2,dx); printf("\n");
	p.a=0;p.b=0;p.c=1; tabulate(foo,x1,x2,dx); printf("\n");
return 0;
}
