c - How can I typedef a function pointer that takes a function of its own type as an argument? -
Example: A function that takes a function (which takes the function (it ...) and one int) and a Int.
typedef zero (* function) (zero (*) (zero (*) (...), int), int); It explodes recurring where (...) is. Is there a basic reason that this can not be done or is there another syntax? It seems that it should be possible without an artist. I'm actually trying to pass a dispatch table, but I can understand that if I can pass this type of one.
You can wrap the function pointer in the string:
Struct fnptr_struct; Typefif zero (* fnptr) (struct fnptr_struct *); Struct fnptr_struct {fnptr fp; }; I'm not sure that this is improving casting. I suspect that without composition it is impossible because the type is required to be defined before using C and there is no opaque syntax for typedef.
Comments
Post a Comment