I have 2 functions that have same parameters and return type. Like
int fun1(int a){
return a+1;
}
int fun2(int a){
return a+2;
}
I made a funtion pointer int(*funptr)(int).
And I want to use malloc and make funptr[0] to point fun1, and funptr[1] to point fun2.
So I tried like
int(*funptr)(int)=(int*)malloc(2*sizeof(funptr));
but it doesn't work. What can I do?