Code:
char (*allFilenames) [9];Why are there parentheses in this statement?
I need a two-dimensional array of which only the second dimension is known beforehand. I read on a page I don't find right now, this would be a way to do it. I've also tried
char **allFilenames;
...
allFilenames = (char**) malloc(fileCount * sizeof(char*));
without success.
Code:
//filenames will be max 8 + 1 without fileendingAre you SURE of this? Generally, SD file names can have 8 characters, plus the dot, plus 3 characters for the extension plus the NULL. That's more than 9.
The filenames in dirBuf.name are without the dot and I don't care about the extension, since it always will be WAV in my case. Hence the
for(int i = 0;i < 8; i++) {
actFilename[i] = dirBuf.name[i];
}