什么是“void *(*)(void *)”是什么意思在C ++? [英] What does "void *(*)(void *)" mean in C++?
本文介绍了什么是“void *(*)(void *)”是什么意思在C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是 pthread_create()
中的参数。我认为每个部分意味着:
-
void *
:返回值是一个void指针。 -
(*)
:这是一个指向函数的指针。 >
是否正确?
解决方案
Yes ,它是一个接受和返回 void *
的无名函数指针的签名。
如果它有一个名称(如在变量中),它将是:
void *(* myFuncName)(void *)
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?
解决方案
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*)
这篇关于什么是“void *(*)(void *)”是什么意思在C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文