I want to create a loop that iterates through all folders and files in a path iteratively. I have the following code (as described here)
#include <filesystem>
#include <iostream>
for (const auto& dirEntry : std::filesystem::recursive_directory_iterator("some path here")) {
std::cout << dirEntry;
}
However, I am getting the following error:
'<<': no operator found which takes a right-hand operand of type 'const std::filesystem::directory_entry' (or there is no acceptable conversion)
Can anybody explain how I can fix this? I am using C++17