Possible Duplicate:
Typedef function pointer?
Could you please help me understand the meaning of this typedef and how to use it?
typedef void (*__handler)(int)
without the "typedef", I know the rest is a function pointer. Thank you.
Possible Duplicate:
Typedef function pointer?
Could you please help me understand the meaning of this typedef and how to use it?
typedef void (*__handler)(int)
without the "typedef", I know the rest is a function pointer. Thank you.
This defines a type name for the function pointer. Using this, __handler
is now a type alias for a pointer to a function that takes an int
and returns void
.
void myFunction(int)
{
// ...
}
int main(int argc, char **argv)
{
__handler functionPtr = &myFunction;
// ...
}