In the below code, I am trying to assign function pointer to array of function pointers. I get the error message
error: initializer element is not constant and then a note says near initialization for 'stateTable2[1]'.
In main, I tried to assign function pointer to another function pointer and no issue.
void function1 (void) // Function definition
{
}
void function2 (void) // Function definition
{
}
void (*fptr)(void) = function2;
void (*stateTable2[]) (void) = {function1,fptr};
int main()
{
void(*fp)(void) = fptr;
return 0;
}