For example, I have to create a struct in a function with the parameters: a function pointer with the format: void (*func)(void *) and an int id.
The struct to create is the following:
typedef struct example {
int id;
void (*func)(void *);
} Example;
Now my question is when I malloc space for the whole struct, do I also malloc space for the void function pointer because it is a pointer? If so, how, since I can't get the size of a void pointer? Thanks.