I need to generate a container of filenames within a directory in C++ and it must be cross platform compatible. Someone recommended using the WIN32_FIND_DATA
data structure. Is this the best option and if so how would I implement it?
The user will not enter the filenames, but rather the C++ function will automatically search the directory and create a container of filenames. I don't know how to read in filenames like this either.
I have a strong focus on standards too, so <dirent.h>
is not an ideal solution because it is not ISO C standard even though its a header in the C POSIX library.