Which files are in a folder? (C++ Question)
(This may sound basic, but I looked through MSDN for hours and found NOTHING.)
In Windows C++, how can I create an array containing the filenames of all the files in a given directory?
Quick search of MSDN..
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/storage_2kft.asp
This example shows you how to find files in a directory and display the filenames to the screen. You can easily store these in a stl string array, and resize the array everytime a new file is found. That's how I would do it.
[edited by - Coaster Kev on August 17, 2002 4:04:15 PM]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/storage_2kft.asp
This example shows you how to find files in a directory and display the filenames to the screen. You can easily store these in a stl string array, and resize the array everytime a new file is found. That's how I would do it.
[edited by - Coaster Kev on August 17, 2002 4:04:15 PM]
boost has a directory iterator as well
Magmai Kai Holmlor
"Oh, like you''ve never written buggy code" - Lee
[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]
[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
Magmai Kai Holmlor
"Oh, like you''ve never written buggy code" - Lee
[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]
[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement