Is there a way to append an unsized array (of strings) to the end of another one? I have the following incomplete function:
(try-catch omitted).Code:String* all_files(String* sDir)[] { String* f[] = Directory::GetFiles(sDir); int numFiles = f->get_Length(); // The new items in f[] are added to the old ones and stored in files[] (the problem) String* d[] = Directory::GetDirectories(sDir); int numDirs = d->get_Length(); for (int i=0; i < numDirs; i++) { all_files(d[i]); } return files; }
The function basically is *supposed* to return an array of strings containing the full path of all the files in sDir. But I can't figure out how to add the new items in f[] to the old ones to generate the output. Btw as you can see I don't have any definitions for variable "files"; this is because I don't know where to define it. Vectors didn't work here.
Any help is appreciated.



LinkBack URL
About LinkBacks


