开发者

C++, console Application, reading files from directory

开发者 https://www.devze.com 2023-01-06 20:45 出处:网络
I have a directory and I want to read all the text files in it using C++ and having windows OS also using开发者_运维技巧 console application

I have a directory and I want to read all the text files in it using C++ and having windows OS also using开发者_运维技巧 console application I don't know the files' names or their number thanks in advance


Take a look at Boost.Filesystem, especially the basic_directory_iterator.


If you want the C++ and portable way, follow the solution by @Space_C0wb0y and use boost.Filesystem, otherwise, if you want to get your hands dirty with the Windows APIs, you can use the FindFirstFile/FindNextFile/FindClose functions.

You can find here an example related to them.

0

精彩评论

暂无评论...
验证码 换一张
取 消