Thread: problem inserting node in middle of list

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Code:
    else
                {
                    std::cout << "The end of the list has been reached so the node will be added to the end." << std::endl;
                    createNode(name);
                    return;//causes method to end prematurally, which we want
                }
    So when do you tie that new node to the end of the list?

  2. #2
    Registered User
    Join Date
    Apr 2010
    Location
    Vancouver
    Posts
    132
    Quote Originally Posted by tabstop View Post
    Code:
    else
                {
                    std::cout << "The end of the list has been reached so the node will be added to the end." << std::endl;
                    createNode(name);
                    return;//causes method to end prematurally, which we want
                }
    So when do you tie that new node to the end of the list?

    createNode(name); does it.

    Sorry I ment createNode(aName)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 04:09 AM
  2. Pleas take a look & give a critique
    By sh3rpa in forum C++ Programming
    Replies: 14
    Last Post: 10-19-2007, 10:01 PM
  3. compiler build error
    By KristTlove in forum C++ Programming
    Replies: 2
    Last Post: 11-30-2003, 10:16 AM
  4. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM