0

typedef void (* mac_callback_t)(void *ptr, int status, int transmissions);

What this typedef is defining here? I am nt able to understand.

  • It's defining type `mac_callback_t` to be a pointer to a `void`-valued function that takes three arguments whose types are `void *`, `int`, and `int`, respectively. – Tom Karzes Oct 05 '17 at 09:45
  • If you remove the `typedef` keyword, what remains is the declaration of a variable named `mac_callback_t`. Its type is a pointer to a function with three arguments (whose types are `void *`, `int` and `int` in this order) that doesn't return anything. Adding the `typedef` keyword changes it into a declaration of a type. `mac_callback_t` is the name of a new type that is a pointer to a function with three arguments (blah, blah, blah) that doesn't return anything. – axiac Oct 05 '17 at 10:13

0 Answers0