I’m looking for a function that will return a list of what is in a particular directory.
The closest that I have gotten is by using this:
system("dir");
But this only prints the contents of the working directory, and I can’t CD to anywhere else.
I’m using windows, and I have no plans to make it cross-platform, so don’t worry about that.
Look at the following example directly copied from this page. It uses
boost::filesystemso works on all major systems.