typedef is one of your friends. Declare the type alias pointer to your required array:
typedef char (* ptr_to_char_arr_10) [10];
Now use it for myfunc:
ptr_to_char_arr_10 myfunc(ptr_to_char_arr_10 p) {
/* do something */
*p[0] = 42;
return p;
}
And now use it to use myfunc:
int main ( void )
{
char char_arr_10 [10] = {0};
ptr_to_char_arr_10 arrp = myfunc(&char_arr_10) ;
assert( *arrp[0] == 42 );
return EXIT_SUCCESS ;
}
Godbolt
Pointer to the array is a powerful concept. For further inspiration perhaps see it here, used with Variably Modified Types and heap allocation.
Bonus
The question is actually titled: "c programming language fixed-size array". Arrays as function argument actually can be declared with a "fixed" size.
// "fixed " array argument declaration
static void dbj_assign(
char val_,
// run time size of the array arg.
const int count_,
// array argument of a minimal required size
char char_arr [static count_]
)
{
/* char_arr can not be null here*/
/* do something */
char_arr[0] = val_;
}
That char_arr argument is also a Variably Modified Type (VMT), with minimal size required also declared. Usage is in the same Godbolt.
myfuncto simply return its function argument, but this would only make sense if the argument and the return value were of the same type. Are you asking how to cast a pointer fromchar (*)[10]tochar *?por*psince those are two very different things.*pis in fact achar *, so your function is correct as is.char (*myfunc(char (*p)[10]))[10]is a function that takes a pointer-to-an-array and returns a pointer-to-an-array. The absolutely horrible syntax is the reason that you won't often see this. What are you actually trying to accomplish?