If you've got a recent version of GCC, you should be able to use std::filesystem. If not, try boost::filesystem. They both have methods to walk the file system. If you're masochistic, you could use ftw() include <ftw.h>.
... Yes, like the list of files output from blender like this;
Instead of strcmp in this situation, since you've already got a vector of strings with those file names, I would prefer to use the find() function from the string class.
1 2 3 4 5 6
if(files[i].find("myout_", 0) != std::string::npos )
// parse the number out of the file if you need that info
// do some processing on the file
Also the string's substr function might be useful for finding all files of a certain extension
1 2 3 4 5
string fName = files[i];
if(fName.substr(fName.length() - 4) == ".ext")
// found a file that ends in ".ext", now do something with it...
Out of curiosity, have you looked into elb's suggestion about std::filesystem? I hadn't read much into c++17 and was not aware of all that it offers when I suggested dirent.h, and it offers it in a cross-system manner which means only learning one library and being able to build the same code on almost any system... Nothing wrong with dirent.h, but there may be many benefits to the other option...
There are several methods in the link above. It looks to me that the easiest is just to open the path as a folder using openddir(filePath), and if it returns NULL then it either is a file, the path is incorrect, or you do not have permissions to read that folder.
If you need more specific info on what the path is, then you could use the stat.h method.