[c++] 디렉토리 내 파일 목록 확인하기
#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;
    }
    return 0;
}

위 코드에서 /path/to/directory 부분에는 실제 디렉토리 경로가 들어가야 합니다. 이 코드를 실행하면 해당 디렉토리 내의 파일 목록을 출력할 수 있습니다.

참고문헌: