Sign in to follow this  

Save all the files names from a directorie in an array

This topic is 3857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quote:
Original post by guvidu
Hy there!

I need to save all the files names from a directory in an array ? Is there a way to do that in C++?

Thanks!
Quick answer: No.
Long answer: Not in a platform independant way, but there are various OS specific ways. Check out FindFirstFile if you're using Win32.

Share this post


Link to post
Share on other sites
Or, put differently:

You can use C++ to iterate through files. What you do with them is up to you (you can find out the filename, and store that in an array).

But the methods are generally not portable, so there is no one answer.

If you describe the OS you're using, then it's possible to give an answer.

Boost is one way of doing it in portable fashion.

Share this post


Link to post
Share on other sites

This topic is 3857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this