When my function storefiles() returns to main ,the names of the files that it should have stored in my arguement vector are not there,or at most only one is there.
As you can see in storefile() there is a for loop that steps along the arguement vector to make sure all the files that should be there are there.
This works fine.
But if i do the same thing in main() once storefiles has returned, none;or maybe one or two of the filenames are there ??.
I was thinking about making "store" external but I thought pointers negated the need for this?
I added retrun store line ,equating it to the store variable in main() thinking that realloc was moving the storage to a different place,but this didn't help
thanks in advance.
char **storefiles(struct dirent *dS,char **store,int count,int len)
if((store=(char**)realloc(store,sizeof(char *) * c))==NULL)
if((*(store+count)=(char *)malloc(sizeof(char *) * len))==NULL)