I am reviewing some C code, but having a hard time understanding what Callback is exactly. Does anyone know what this means? I’m guessing that it is defining “Callback and x to be both a void *?
typedef void (*Callback)(bool x);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It makes a new type name
Callback. EveryCallbackwill be a pointer to a function taking abooland returningvoid. In effectCallbackwill be an alias for that real type. So when you say:You’re making a function pointer that points at
some_fun. Function pointers are typically passed to other functions as arguments.