I'm trying to create typedef to function pointer which returns matrix of struct. I tried:
typedef struct my_struct** (*func)(void)
typedef struct my_struct[4][4] (*func)(void)
but none of them worked. My matrix of struct is initialized like:
static struct my_struct matrix[4][4];
my code didn't compiled with the 2 options of typedef. How should I create this typedef? Thanks.
Arrays cannot be returned. You can however return a pointer to an array. This is what should be returned if you want to retrieve your 2d array from a function.
The function would return a pointer to an array of 4 structs:
typedef of this type: