typedef int (fc_name) (void);
Here fc_name
is any valid C symbol.
How different is this from a function pointer typedef
?
It's a typedef
to a function type. The intent is to use it for function pointers, but in this case the syntax to use it would be:
int bar(void);
fc_name* foo = bar; /* Note the * */
Update:
As mentioned in the comments to Jonathan Leffler's answer, the typedef
can be used to declare functions. One use could be for declaring a set of callback functions:
typedef int (callback)(int, void*);
callback onFoo;
callback onBar;
callback onBaz;
callback onQux;