char * myFunction () { char sub_str[10][20]; return sub_str; } void main () { char *str; str = myFunction(); }
error:return
Reason: you need the return type to be char(*)[20]. But even in this case you don't want to return a pointer to a local object from the function. Do: Use malloc to allocate sub_str, and return char**.
char(*)[20]
char**