What is the difference between the following two statements?
char *(*myfunc1)(char*, int)
char *myfunc2(char*, int)
I know that the second statement defines a function which receives a pointer to char and an int and returns a pointer to char. I also know that char (*myfunc2)(char*, int), would return a char.
What does the extra * mean in the first statement?
the first one defines a pointer to a function, the second one is a function....
so that you could do ... myfunc1 = myfunc2
whenever you see what looks like a function, but the name of the function is in brackets with a * like void (*blah)( void ) it means you are defining a pointer to a function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With