Just a quick question:
How do I get an array or something like that of all the files in a directory.
Thanks in advance!
Just a quick question:
How do I get an array or something like that of all the files in a directory.
Thanks in advance!
It depends on what operating system and compiler you are using.
Sorry about that...
I've got Windows and I use MingW and Cygwin, but mostly MingW.
You need to fill a WIN32_FIND_DATA struct with a call to FindFirstFile() and then iterate through the directory with FindNextFile() until it returns INVALID_HANDLE_VALUE. Each time FindNextFile() returns sucessfully the filename will be a member of the WIN32_FIND_DATA struct which you could use to fill an array. You'll need to include windows.h; search the boards/MSDN for an example if needed.