Check out example codes for "c++ get files in directory". It will help you in understanding the concepts better.

Code Example 1

#include <string>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;

int main() {
    std::string path = "/path/to/directory";
    for (const auto & entry : fs::directory_iterator(path))
        std::cout << entry.path() << std::endl;
}

Learn ReactJs, React Native from akashmittal.com