I am trying to make a struct which has a function pointer for a function that takes the same struct as an argument. I have this at the moment.
typedef struct sharedData
{
sem_t* forks;
int id;
void (*forkFunc)(sharedData*);
};
I am getting errors like
error: expected ‘)’ before ‘*’ token
and warnings like
warning: no semicolon at end of struct or union
warning: useless storage class specifier in empty declaration
What am I doing wrong here?