Here's a relatively good solution that should work on a cross platform. You will need to change the section of code in which you want to do something, but otherwise it should work quite well.
#include <cstring>
This is fairly concise code and will list all the subdirectories and files in the directory. If you want it to display all the contents in each subdirectory, you can call the function recursively by passing it to the subdirectory on the line that displays "This is a directory." Something like a list (fileinfo.name); gotta do the trick.
legacybass
source share