How do I get a list of files in a directory in C++?

后端 未结 13 1444
南旧
南旧 2020-11-28 23:36

How do you get a list of files within a directory so each can be processed?

13条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 23:47

    You have to use operating system calls (e.g. the Win32 API) or a wrapper around them. I tend to use Boost.Filesystem as it is superior interface compared to the mess that is the Win32 API (as well as being cross platform).

    If you are looking to use the Win32 API, Microsoft has a list of functions and examples on msdn.

提交回复
热议问题