What is the difference between
extern int (*func)(void);
and
extern int *func(void);
Thanks
extern int (*func)(void);
declares func
as a pointer to a function which takes no arguments and returns an int
value.
extern int *func(void);
is a forward declaration (a.k.a. a protptype) of func
as a function that takes no arguments and returns a pointer to an int
.
The first declares a variable, the second declares 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