What’s going on in this function prototype? Obviously the void parameter with some sort of typecasting is confusing…
int *my_func(my_struct *m, void (*m_op)(my_struct *v, void arg));
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.
The second argument to the function
my_funcis a pointer to a function that returns no value (void), but which takes two arguments, amy_structpointer and … and (an invalid)void. The latter should probably bevoid *arg; you cannot have a variable or argument of typevoid. As it stands, the code should not compile.