2 ms·
It allows the later definition of func * f which is more readable and maintainable than int (* f)(int arg) This pattern is common in well-structured applicatio
by inopinatus 9y ago
It allows the later definition of func * f which is more readable and maintainable than int (* f)(int arg)
This pattern is common in well-structured applications, and is especially useful for clarifying external and internal APIs. e.g. from the Dovecot IMAP server:
typedef bool event_callback_t(struct event *event,
enum event_callback_type type,
struct failure_context *ctx,
const char *fmt, va_list args);
You can now define a function pointer or declare a parameter using event_callback_t. This is both concise and intention revealing.