Thank you, but I already tried that and it works as you said , but in this case I want to pass an argument to the function in the array. Since the function does the same thing (It print the properties of each task), I figured that I just have to pass the name of the task to each instance of a function-pointer inside the task.
Otherwise I will have to go with the old route and write four functions, one for each task.
So my question is : Is there a way to pass an argument to a function inside an array of function pointers ?
On the main file I am using a switch construct to select the appropriate function that should be executed based on the value of an index.
Hi, I have declared a function pointer
and then I use an array as in
The execute function has the same form
where each task1,task2 is a char array. The thing is I am getting an error where it declares that a value of type void cannot be used to initialize an entity of type fpTasks. What i find confusing is that the fpTasks function pointer is of type void. Any idea how can I fix this. Thanks.