Hello,
I'm trying to return a pointer to an array of pointers to char. Basicly, I need to pass few strings from function to main, and for some reasons I can't find any solution to do it.
Function dec/def are most likely wrong, and when I do this as in code above, I'm getting:Code:#include <stdio.h> #include <conio.h> #include <stdlib.h> char *(*fun)(void)[]; main() { char *tb[10]; tb = fun(); /* this isn't working */ getche(); return 0; } char *(*fun)(void)[] { char *tab[10]; int i; for (i=0; i<10; i++) tab[i] = (char*) malloc(20); return tab; }
Looking forward for some help in this case :|Code:incompatible types in assignment of `char* (*)[]' to `char*[10]'