Reputation: 3053
I have a method I need to fill in and one of the parameters is: "void (*destructor)(void*)". Can anyone tell me what this is?
Upvotes: 0
Views: 105
Reputation: 25377
The void (*destructor)(void*)
is a function pointer. This means, that you can use it to point to any function, which has void as return value (returns nothing) and expects an generic pointer (void*
), which can point to anything.
Upvotes: 1
Reputation: 500663
It's pointer to a function that takes a void*
as its only argument, and returns nothing.
Upvotes: 0
Reputation: 12044
That's a function pointer. The function given should have the signature:
void funcname(void*)
The first void is the return type, the second is a pointer to void (in other words, a pointer to who knows what, which the underlying function will presumably cast to some useful type later).
Upvotes: 1
Reputation: 206566
It is a Function pointer.
It stores address of an function which takes a void *
(pointer to void
) as an input parameter and returns no parameter.
Upvotes: 4