3 ms·
Here's an example: typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler); Without the typedef, it's much less clear
by loeg 10y ago
Here's an example:
typedef void (*sighandler_t)(int);
sighandler_t signal(int signum, sighandler_t handler);
Without the typedef, it's much less clear.
Edit: It could instead be written as the non-pointer type:
typedef void (sighandler_t)(int);
And then used as:
sighandler_t *signal(int signum, sighandler_t *handler);
And as a function declaration:
sighandler_t foo;
With the pointer in the typedef, the type can't be used to declare functions.