Thread: freeing linked lists

  1. #1
    Registered User
    Join Date
    Aug 2001

    freeing linked lists

    I am again trying to learn how to create linked lists. This time think I'll be more successful at it.

    Anyways when I free a list do I have to set the head node or pointer to NULL or else I'll get a never ending loop?
    Don't you dare hit me on the head, you know I'm not normal.
    A Stooge Site
    Green Frog Software

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    That will be part of the design.

    If in your list design, you decide that "head == NULL" means the list is empty, then you'll want to set the head to null when the list is free'd or becomes empty.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked Lists 101
    By The Brain in forum C++ Programming
    Replies: 5
    Last Post: 07-24-2004, 04:32 PM
  2. Map file formats and linked lists
    By Spitball in forum Game Programming
    Replies: 2
    Last Post: 03-04-2004, 11:32 PM
  3. Freeing Linked Lists
    By mrpickle in forum C Programming
    Replies: 4
    Last Post: 01-21-2004, 07:57 PM
  4. need help w/ linked lists
    By MKashlev in forum C++ Programming
    Replies: 11
    Last Post: 08-05-2002, 08:57 PM
  5. doubly linked lists
    By qwertiop in forum C++ Programming
    Replies: 3
    Last Post: 10-03-2001, 06:25 PM