I simply need to put all the files (or file names?) within a directory into a vector so that I can sort them and open them in order.
I literally have no idea how to do this since this my first encounter with C++. I have tried boost::filesystem but I am having no success as this is quite unfamiliar to me. Please help!
I've actually found a method I think will work however I am now struggling with adding a linker to the command line but I think if I ask about that here it'll exceed the scope of the original question.
taken from your previous question:
std::vector<std::string> filenames;
dpdf = opendir("/data/files");
if (dpdf != NULL) {
while (epdf = readdir(dpdf)) {
filenames.push_back(std::string(epdf->d_name));
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments