The boost::filesystem:: library can help you with this. Otherwise you'll need to interface with the windows or linux APIs directly. There is nothing in std:: that does this.
If you did use boost, you would do something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
#include <boost/filesystem.hpp>
int main()
{
namespace fs = boost::filesystem;
fs::path WorkingPath("c:\\temp\\"); // Desired directory
fs::directory_iterator StartIter(WorkingPath), EndIter; // This is automatically set to the end of a directory
for (; StartIter != EndIter; ++StartIter) // Iterate through all files in this folder
std::cout << StartIter->path().leaf() << std::endl; // Output filenames
}