[4] comes after the function name, as happens after the variable name in the variable definition:
int (*fn())[4]
{
return &intArray;
}
Since this is a very obscure syntax that tends to be confusing for anyone reading it, I would recommend returning the array as simple int*unless you have any special reason why it should be an -to-array pointer.
You can also simplify function definitions with typedef:
typedef int intarray_t[4];
intarray_t* fn() { ... }
source
share