我想创建一个循环,迭代遍历一个路径中的所有文件夹和文件。我有以下代码(如下所述)
#include <filesystem>
#include <iostream>
for (const auto& dirEntry : std::filesystem::recursive_directory_iterator("some path here")) {
std::cout << dirEntry;
}
但是,我得到了以下错误:
'<<': no operator found which takes a right-hand operand of type 'const std::filesystem::directory_entry' (or there is no acceptable conversion)
谁能解释一下我怎么解决这个问题?我用的是C++17
在
致: