WaveHC: Filenames from SD in array

Because I saw no relevance for the actual problem, that strcpy() does not work.

But, strcpy() does work.

You could use strlen() to get the length of the name of the file. You could then copy all but the last 4 (., w, a, and v). Be sure to deal with the two files in every directory named "." and "..".

I'd personally use an array of pointers, and use strdup() to copy the string to the nth pointer in the array.

char **allFileNames = NULL;

allFilenames = (char**) malloc(fileCount * sizeof(char*));

allFileNames[n] = strdup(dirBuf.name);