In the following lines of code, what does the asterisk in front of dup_func, free_func, and clear_free func, do?
void *(*dup_func)(void *);
void (*free_func)(void *);
void (*clear_free_func)(void *);
In your examples it means they are function pointers.
In a nutshell, they allow you to do things like this:
void example()
{
printf("Example called!\n");
}
void call_my_function(void (*fun)())
{
printf("Calling some function\n");
(*fun)();
}
/* Later. */
call_my_function(example);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With