C++ 列出資料夾所有檔案

  1. Project→Options→Configuration Properties→C/C++→Language:
    C++ Language Standard選擇ISO C++ 17 Standard (/std:c++17)
  2. #include <filesystem>
    
    path folder_path = "..."
    for(const auto& entry : directory_iterator(folder_path)){
        ...對entry.path()處理...
    }

Last Updated on 2023/08/16 by A1go

Bitnami