Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

code equivalent ot MSDOS/WINDOWS tree command

vidyananvidyanan Posts: 2Member
Can anybody help me in writing a c/c++ code which is equivalent to MSDOS tree command?
i really need help here.

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : Can anybody help me in writing a c/c++ code which is equivalent to MSDOS tree command?
    : i really need help here.
    :
    :

    all it does is iterate through hard drive and generate a linked list of all the directories. Start with FindFirstFile(), and FindNextFile(). When a directory is encountered, make a recursive call to your function to process all the files in that directory.

    There is probably a more useful std tree container than the vector in the example below.
    [code]
    void FindTree(std::vector the List, std::string path)
    {
    ...
    ...
    if current file is a directory then call FindTree() again with
    current path + this filename
    ...

    }
    [/code]

  • kiosakoskiosakos Posts: 1Member
    Hi. I a a student on a technological institute of Serres Greece and i have as project to simulate the ms dos tree command on a c programm. Could you please give me a full code example to study cause i read the example here and i wasn't able to write the code. thanks
Sign In or Register to comment.