Hi,
With respect to this question, we can declare a function that returns pointer to array as:
int (*function())[3]
which returns Ax3 array, ok.
How is the proper way to declare a function pointer that points this kind of function?
Hi,
With respect to this question, we can declare a function that returns pointer to array as:
int (*function())[3]
which returns Ax3 array, ok.
How is the proper way to declare a function pointer that points this kind of function?
See this reference, which is quite helpful. Note the techniques using typedefs
typedef int (*pfintarray())[3];
pfintarray myFunc() { /* etc
Perhaps
int (*(*function_pointer)())[3];
(at least gcc seems to understand it)
f -- f
*f -- is a pointer
(*f)() -- to a function
*(*f)() -- that returns a pointer
(*(*f)())[3] -- to a 3-element array
int (*(*f)())[3] -- of int