Hello forum
I've a c progamming question: I want to place a function pointer into a typedef with a function parameter "pointer to the typedef itself":
typedef struct pExampleStructTypdef { char x; void *y; int z; int (*pFuncPtr)(pExampleStructTypdef *, unsigned int); }pExampleStructTypdef
It seems logical that this does not work that way. Does anybody know a solution for this? Thanks!
Slightly modified, it works:
struct ExampleStruct { char x; void *y; int z; int (*pFuncPtr)(struct ExampleStruct *, unsigned int); };
I never understood the desire to get rid of struct using typedef. If your code becomes too long with struct, the problem is with the code, not with struct.
Thanks for the answer. You are correct with your objection of using typedef... I will try it