![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 1
Rep Power: 0
![]() |
I am trying to add the names of the subfolders within a folder to an array of strings but I am completely stumped as to how to retrieve the names of the subfolders. Any ideas? I would like to perform this operation natively (not managed). Also, I am a bit of a noob here, so could you pose an answer appropriately.
Thanks. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Appropriately? Yes. Read your documentation regarding file operations, write some code, and ask for help with the problems. Consider the string class and vectors, as well a C-style strings and arrays. Words like "findfirst" and "findnext" pop into my mind.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
To add something to Dawei's post, here is a link which may help you: Linky-dinky
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3
![]() |
The Boost Filesystem library is an alternative to DaWei's suggestion but you'll need to spend the necessary time to get a handle on the Boost libraries
__________________
Visit my website BinaryNotions. |
|
|
|
|
|
#5 | ||
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,206
Rep Power: 5
![]() |
Quote:
Under unix, the functions to support this ARE named findfirst() and findnext(). Under the win32 API, the functions to support this are named FindFirstFile() and FindNextFile(). I assume this means you are using "Managed C++", which I assume means you are working on a Microsoft operating system within the .NET environment. So the win32 API is probably a solution for you. But that's just a guess, as I do not use Managed C++. If by "not managed" you are referring to something different, then see below. Quote:
As a newbie, I would suggest you need to learn how to post a question appropriately. To that end, I suggest reading the sticky post in the C++ forum entitled "How to ask a question" --- it is right at the top of the list of threads. People who participate in these forums are not mindreaders. If, as you have done, ask a question which is not particularly clear, you can expect unclear answers. |
||
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| returning value from an enumeration | angry_asian | C++ | 14 | Jun 29th, 2006 8:06 PM |
| problem with defining enumeration variable | biohazard | C++ | 2 | Feb 17th, 2006 6:01 PM |
| Passing 'enumeration' values | Kilo | C# | 4 | Dec 15th, 2005 1:31 PM |
| callback example for file/directory enumeration | c0ldshadow | C++ | 1 | Jun 10th, 2005 5:41 PM |