• Advertisement
Sign in to follow this  

Listing dir

This topic is 4938 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

Advertisement
well, i was a few minutes late in beating the MSDN example, but i came up with this:


void pwd()
{
WIN32_FIND_DATA data;
HANDLE first = FindFirstFile("*.*", &data);
std::cout << data.cFileName << "\n";

while(FindNextFile(first, &data))
std::cout << data.cFileName << "\n";
}



it seems to work well, and may be a little simpler to read. btw: include windows.h.

EDIT: and you would want to store in a string instead of outputting, of course.

[Edited by - anist on August 16, 2004 12:07:53 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by anist
well, i was a few minutes late in beating the MSDN example, but i came up with this:

*** Source Snippet Removed ***

it seems to work well, and may be a little simpler to read. btw: include windows.h.

EDIT: and you would want to store in a string instead of outputting, of course.


Wow, im going to use that. May way was so much more complicated.

Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement