Looking for a way to find the name of random files and store them into an array.

I am new to programming, I have completed my first year in college and I am trying to get better at programming and join projects and code different things to gain programming experience. So bare with me please.

So what im stuck on is this some file i/o.

I am trying make it so I can type in a directory in the console such as..C:\Users\Cullen\Documents\C++\...and then use that directory to stick all of the filenames that are in that directory weather its a txt file, folder, or anything into a string array. And that is what i need help with.

If I can get this working I am going to open each file in the directory in a loop with an index.

Last edited on
Sounds like you're asking how to read the contents of a directory on a Win32 system


If you're willing to add some third party headers, there are simpler ways (dirent.h and boost spring to mind).
Last edited on
I am very much so but I dont know how to implement this into my own code. because im not sure what tmain is, and I am trying to make this a class function

I am willing to add different headers. Ill look up how to use both dirent.h and boost, I hope i can get this going, I've never used a third party header.
Last edited on
tmain is a Win32 mung of main.
Topic archived. No new replies allowed.