12

It's the parameter in pthread_create(). I think each part means:

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

  • (*): It's a pointer to a function.

  • (void *): It takes an untyped pointer as a parameter.

Is that correct?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Marty
  • 5,576
  • 8
  • 49
  • 86

1 Answers1

12

Yes, it is the signature of a nameless function pointer that takes and returns void *.

If it had a name (as in a variable) it would be:

void *(*myFuncName)(void*)
Constantino Tsarouhas
  • 6,786
  • 6
  • 44
  • 54
Michael Chinen
  • 16,297
  • 5
  • 32
  • 45
  • For which compilers is this syntax legal? The R package igraph does not compile on the CRAN Solaris server due to a "syntax error" around the use of "void (*)(void)": https://www.r-project.org/nosvn/R.check/r-patched-solaris-x86/igraph-00install.html – landau Jul 20 '17 at 15:58