I’m trying to write a small block of code that prints out the files in a given directory. I’ve seen references to using the direct.h library to do this, but I cannot find any documentation whatsoever on the header file and its methods. Is this library outdated? And is there another way to list all filenames of a directory in C++?
I’m trying to write a small block of code that prints out the files
Share
It seems that this header functions are not designed for this task, See http://msdn.microsoft.com/en-us/library/as5kw0ze(v=vs.110).aspx
Use FindFirstFile, FindNextFile and FindClose loop like in this example code