【发布时间】:2011-04-30 08:35:43
【问题描述】:
在 C++ 中,在 Windows 上列出目录中所有文件的最佳方式是什么?
在 Linux 或使用 gcc(例如 MingW)的 Windows 上,使用 dirent.h 很容易,但是当 dirent.h 不可用时(例如 Visual Studio)在 Windows 上执行此操作的最佳方法是什么?
我是否应该强制人们将免费提供的 dirent.h 实现添加到他们的 Visual Studio 中?或者我应该写一个替代代码来读取文件?如果是这样,最好的代码是什么?
谢谢。
【问题讨论】:
标签: c++ windows list file dirent.h