Question

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

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top