#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;
}
#include <iostream>
#include <vector>
#include <string>
#include <filesystem>
using std::cout; using std::cin;
using std::endl; using std::string;
using std::filesystem::recursive_directory_iterator;
int main() {
string path = "./";
for (const auto & file : recursive_directory_iterator(path))
cout << file.path() << endl;
return EXIT_SUCCESS;
}
#include <iostream>
#include <vector>
#include <string>
#include <filesystem>
using std::cout; using std::cin;
using std::endl; using std::string;
using std::filesystem::recursive_directory_iterator;
int main() {
string path = "./";
for (const auto & file : recursive_directory_iterator(path))
cout << file.path() << endl;
return EXIT_SUCCESS;
}