What does "void * (*) (void *)" mean in C ++?

This is the parameter in pthread_create() . I think every part means:

  • void * : the return value is a void pointer.

  • (*) : This is a pointer to a function.

  • (void *) : An untyped pointer is required as a parameter.

Is it correct?

+6
source share
1 answer

Yes , this is the signature of an unnamed pointer to a function that accepts and returns void * .

If it has a name (as in a variable), it will be:

 void *(*myFuncName)(void*) 
+7
source

Source: https://habr.com/ru/post/908941/


All Articles