What does “void *(*)(void *)” mean in C++?

╄→гoц情女王★ 提交于 2019-11-26 21:53:07

问题


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?


回答1:


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*)


来源:https://stackoverflow.com/questions/9371171/what-does-void-void-mean-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!