dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: recursive search in c++

  1. #1
    Join Date
    Aug 2009
    Posts
    5

    recursive search in c++

    Im new to c++. I am trying to search for all *.jpgs recursively with a console application. All I can find on Google is for non console programs.

    Does anyone know any sample codes or something to get started?

    additional info:
    windows xp
    visual studio express 2008 c++
    Last edited by joshua.carcione; August 13th, 2009 at 12:47 PM.

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: recursive search in c++

    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: recursive search in c++

    You could use Boost.Filesystem.

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: recursive search in c++

    Quote Originally Posted by Lindley View Post
    You could use Boost.Filesystem.
    Adding an entire library just for a simple recursive function ?

  5. #5
    Join Date
    Aug 2009
    Posts
    5

    Re: recursive search in c++

    cilu - I tried to use the sample code but it would not compile...

    BTW I only need this for windows.

    anything else?

  6. #6
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: recursive search in c++

    Quote Originally Posted by Skizmo View Post
    Adding an entire library just for a simple recursive function ?
    It's not a big deal if someone is already set up to use Boost. And I think everyone should be.

    Besides which, delving into Win32 land to accomplish the same thing is also adding a library, assuming one has stayed with the standard stuff until now.

  7. #7
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: recursive search in c++

    Quote Originally Posted by joshua.carcione View Post
    cilu - I tried to use the sample code but it would not compile...

    BTW I only need this for windows.

    anything else?
    Of course it does. That code is verified. Please post the code you used and the errors messages you got.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  8. #8
    Join Date
    Mar 2008
    Location
    Turin / Italy
    Posts
    178

    Re: recursive search in c++

    Confirm. That code works and it's very fast. Been using it anytime i need to create a list for certain types of files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)