Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this expression: void* (*fct)(void*(*)(void*), void*)?

Tags:

c

pthreads

I know that e.g.

void *(*myFuncName)(void*)

is a function pointer that takes and also returns void*.

Is this a pointer which takes 2 arguments? A void pointer another function of that type returning void* and a void*? I'm just guessing..

like image 462
MrCotton Avatar asked Mar 21 '26 11:03

MrCotton


1 Answers

void* (*fct)(void*(*)(void*), void*);  

declare fct as a pointer to a function that

  • returns a void *
  • expects its first argument is of type pointer to a function that expects a void * and returns a void * and
  • expects its second argument is of type void *.
like image 98
haccks Avatar answered Mar 23 '26 01:03

haccks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!