Thread: Linked list tail

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    65

    Linked list tail

    hello i cannot understand why everytime we add a new entry in list we moving the tail with that way
    Code:
             l->tail->next=new_entry;
    	    	  l->tail=new_entry;
    shouldn't we use just one of them
    what's the difference that force us to use both lines
    l is the basic list and new_entry the new we must add
    Last edited by cable; 10-08-2011 at 11:43 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked List - Add to Tail
    By beatbox32 in forum C Programming
    Replies: 9
    Last Post: 08-08-2011, 03:43 PM
  2. doubly linked list tail pointer in struct
    By bazzano in forum C Programming
    Replies: 15
    Last Post: 06-11-2007, 12:31 PM
  3. loosing tail in doubly linked list
    By bazzano in forum C Programming
    Replies: 5
    Last Post: 05-06-2007, 11:46 PM
  4. Another List Q - Seg fault on head-tail list
    By JimpsEd in forum C Programming
    Replies: 11
    Last Post: 05-10-2006, 12:53 AM
  5. tail pointer - linked list
    By Space_Cowboy in forum C++ Programming
    Replies: 1
    Last Post: 12-02-2002, 03:05 AM