Thread: Easiest way to browse for contents of a folder and store them in a string vector

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    222

    Easiest way to browse for contents of a folder and store them in a string vector

    What would be the easiest method of finding how many as well as all the filenames present in a selected directory? After that, I'm pretty sure I can store the information into a vector of some sort.

    Thanks in advance.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    It depends on your platform, though there are cross platform libraries available such as Boost.Filesystem (which would make for a pretty easy way to do what you want to do, I think).
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed