Search:

Type: Posts; User: kawafis44

Search: Search took 0.00 seconds.

  1. Replies
    33
    Views
    4,709

    > It looks like you are creating a root for every...

    > It looks like you are creating a root for every block. This is not a good idea. You need one root for the entire tree. In your example the root should be for E:\.


    But I've got this line:
    ...
  2. Replies
    33
    Views
    4,709

    This is example of input file (but program should...

    This is example of input file (but program should support some different language versions and different versions of dir/s command dependent on version of Windows):


    Wolumin w stacji E nie ma...
  3. Replies
    33
    Views
    4,709

    I changed this code a little. Now question one is...

    I changed this code a little. Now question one is answered - I won't be using integer number to indicate directories but lineInFile to indicate line of input file where I've got information about...
  4. Replies
    33
    Views
    4,709

    I've got still some problems. It is my actual...

    I've got still some problems.
    It is my actual code:


    /*
    Program of navigating the directory tree, displaying subdirectories and
    files in current directory. The program uses output of the dir/s...
  5. Replies
    33
    Views
    4,709

    About my second question: I think I have done...

    About my second question:

    I think I have done it. I used:
    sub1.children.push_back(sub11);
    And now I use:
    sub1->children.push_back(sub11);

    This is code about using tree structure:

    int...
  6. Replies
    33
    Views
    4,709

    Thanks! I've got two other questions - they are...

    Thanks!
    I've got two other questions - they are written inside the code.
    Thanks in advance :)


    /*
    Program of navigating the directory tree, displaying subdirectories and
    files in current...
  7. Replies
    33
    Views
    4,709

    About pushing back subdirectories: I know that...

    About pushing back subdirectories:
    I know that root is an object and sub1, sub11, ..., sub311 are pointers. I create object root and I add sub1, sub2, sub3 to children vector of root by pushing them...
  8. Replies
    33
    Views
    4,709

    Thanks! My new code: #include ...

    Thanks!
    My new code:


    #include <iostream>
    #include <vector>
    #include <fstream>
    using namespace std;

    class Directory
  9. Replies
    33
    Views
    4,709

    OK, so I'll follow #1 and maybe after finishing...

    OK, so I'll follow #1 and maybe after finishing the whole project I will try to change it with using #2. Is it the proper way? (I've got a problem with destructing these children)


    #include...
  10. Replies
    33
    Views
    4,709

    Thanks! Which of these solutions will be the best...

    Thanks! Which of these solutions will be the best for storing directories? I want to read directories from file which is created in this way "dir /s > myfile.txt" and creating process will be...
  11. Thread: try & catch

    by kawafis44
    Replies
    5
    Views
    1,544

    I heard that using exceptions is if I've got...

    I heard that using exceptions is if I've got situation which shouldn't happen and probably won't happen at all - this is why we call it exception. I don't use 'if' because I guess it will never...
  12. Thread: try & catch

    by kawafis44
    Replies
    5
    Views
    1,544

    try & catch

    I've got this code (it is only part of my code):


    int main(void) {

    ifstream fin("myfile.txt");
    string line;
    int counter=0;

    string nameMainDir; //it contains line " Directory:...
  13. Replies
    33
    Views
    4,709

    Thanks! Now I've got two questions: 1) how can I...

    Thanks! Now I've got two questions:
    1) how can I create copying constructor (and do I really need it? - line print(root); couldn't be compiled so I thought it may be caused by the lack of copying...
  14. Replies
    33
    Views
    4,709

    OK, now I've got the other idea and the other...

    OK, now I've got the other idea and the other code. But I don't know 1) where I've got memory outflow (what kind of situation can cause this memory outflow), 2) how to avoid it/ improve the code...
  15. Replies
    33
    Views
    4,709

    This is what I've got - main and then dir1, dir2...

    This is what I've got - main and then dir1, dir2 on the same level. I saved a copy of iter to parent after creating "main" and before "dir1". But I guess there is a problem with "output the dir tree"...
  16. Replies
    33
    Views
    4,709

    //typedef tree treeDir; tree ...

    //typedef tree<dir> treeDir;
    tree<dir> leafDir; //it creates tree of dir
    //I need two variables
    //"One to hold the current parent, and the other to save the result of insert".
    //Is...
  17. Replies
    33
    Views
    4,709

    Sorry for the stupid question but how to do it...

    Sorry for the stupid question but how to do it (how to write the proper code)? I was trying to do it and I don't know how. Thanks for help :).
  18. Replies
    33
    Views
    4,709

    It is my code but based on the code from that...

    It is my code but based on the code from that site (the link is given in my first post).

    I changed this listing from previous message - now there is also possibility to see the results of creating...
  19. Replies
    33
    Views
    4,709

    tree container

    Hello! It is my first post and I've got probably easy question. I can use containers like list, vector. But I think there is no tree container in standard containers of C++. I found this site...
Results 1 to 19 of 21