How can I determine the list of files in a directory from inside my C or C++ code?
I\'m not allowed to execute the ls command and parse the results from
ls
System call it!
system( "dir /b /s /a-d * > file_names.txt" );
Then just read the file.
EDIT: This answer should be considered a hack, but it really does work (albeit in a platform specific way) if you don't have access to more elegant solutions.