Since it is a recursive function you cannot return the list of files, you need to pass a list as a parameter and that list will be filled in:
void all_files(String* sDir, ArrayList *files)
{
files->AddRange(Directory::GetFiles(sDir));
String* d[] = Directory::GetDirectories(sDir);
int numDirs = d->get_Length();
for (int j = 0; j < numDirs; j++)
{
all_files(d[j], files);
}
}
|