Search:

Type: Posts; User: jk1998

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    2,640

    I tried child_ptr = new binary_tree_node(entry,...

    I tried child_ptr = new binary_tree_node(entry, target, NULL, NULL); but it did not help. I still get left2->leaf() and right2->leaf() false. They are suppose to be true. I don't see where the...
  2. Replies
    7
    Views
    2,640

    Sorry here it is ...

    Sorry here it is


    binary_tree_node::binary_tree_node(const string& init_data, const unsigned int& init_index, binary_tree_node* init_left, binary_tree_node* init_right)
    {

    ...
  3. Replies
    7
    Views
    2,640

    After replaced root_ptr->set_left(child_ptr) with...

    After replaced root_ptr->set_left(child_ptr) with cursor->set_left(child_ptr) and root_ptr->set_right(child_ptr) with cursor->set_right(child_ptr), I am able to generate
    ___________________root_ptr...
  4. Replies
    7
    Views
    2,640

    Generating new nodes at the end is all I needed....

    Generating new nodes at the end is all I needed. Thanks
  5. Replies
    7
    Views
    2,640

    Binary tree not inserting nodes correctly

    I am writing a insert function that will insert nodes into the binary tree according to their index. For example, if the tree is NULL, it will insert into the root_ptr, if the index is less than...
  6. Thread: ifstream error

    by jk1998
    Replies
    5
    Views
    1,289

    Thanks:)

    Thanks:)
  7. Thread: ifstream error

    by jk1998
    Replies
    5
    Views
    1,289

    ifstream error

    I want the following function to open a file which the name of the file is stored in file_name. However, when I tried to compile it, I received no matching function for call to...
  8. Replies
    2
    Views
    3,128

    Binary Taxonomy Tree

    I am writing a binary taxonomy tree program that reads from an file and reconstruct the tree. The program will learn from the users and expand the tree.
    The requirement is each node must contain an...
  9. Thread: stringstream

    by jk1998
    Replies
    2
    Views
    1,792

    thanks :)

    thanks :)
  10. Thread: stringstream

    by jk1998
    Replies
    2
    Views
    1,792

    stringstream

    I created a stringstream but I don't know how to clear the memory.
    Example


    stringstream sstring;
    int a = 12;
    int b = 14;

    sstring << a;
    cout << sstring.str();
  11. Replies
    3
    Views
    1,055

    Thanks :)

    Thanks :)
  12. Replies
    3
    Views
    1,055

    Not returning the correct string

    Here I have a function that suppose search a stack and return the substring if found the match otherwise return Not exist. However, it somehow always return Not exist. I don't see why. Could...
  13. Replies
    4
    Views
    1,057

    thanks

    thanks
  14. Replies
    4
    Views
    1,057

    What are these numbers?

    I have the following function, when it is called, it printed out two sets of numbers 0x3d2468 and 0x3d2590. What are these numbers represent? What are they used for? Thanks in advance.


    typedef...
  15. Replies
    1
    Views
    2,656

    I missed student_record in my makefile. Thanks...

    I missed student_record in my makefile. Thanks anyway
  16. Replies
    1
    Views
    2,656

    unix makefile won't work but works in Dev C++

    I have three file impletment.cc , main.cc and student.h.

    Here is my makefile


    CC = g++

    student_record: main.o impletment.o
    $(CC) -o main.o impletment.o
  17. Replies
    2
    Views
    1,258

    Thanks

    Thanks
  18. Replies
    2
    Views
    1,258

    How to store file in current directory

    I know by writing this
    ofstream school_file ("C:\\Student_data.txt") a file name Student_data.txt will store in C drive. But how do I store the file in the directory of the program run or current...
  19. Replies
    19
    Views
    6,672

    Thanks

    Thanks
  20. Replies
    19
    Views
    6,672

    I looked at the link. Why we needed the...

    I looked at the link. Why we needed the myflush() for the C++ implementation?
  21. Replies
    19
    Views
    6,672

    Replacing system("PAUSE")

    I know that using system("PAUSE") to pause a running program is bad. But I need it so that user can read the output. Is there any way to achieve the same effect of system("PAUSE") without using it?...
  22. Replies
    6
    Views
    5,569

    Thanks. I found a way around it.

    Thanks. I found a way around it.
  23. Replies
    6
    Views
    5,569

    I tried to substitute cin >> ans with the...

    I tried to substitute cin >> ans with the following function with ans=YorN(), but it is still doing the same thing. getline(cin, fx) still picks up the Enter key.
    Please help.



    char YorN()
    {...
  24. Replies
    6
    Views
    5,569

    OK, I know why it goes to that else. Actually,...

    OK, I know why it goes to that else. Actually, it went into that else because user has to press Enter. The Enter triggered the getline(cin, fx), which then went to that else, not because of 'y'.
    ...
  25. Replies
    6
    Views
    5,569

    I found similar post from the forum, but I have...

    I found similar post from the forum, but I have another problem.
    The code below I replaced ans=getch() with cin >> ans, but it fell into the next else(assuming user enter 'y') and printed. It was...
Results 1 to 25 of 42
Page 1 of 2 1 2