need some help on understanding and using Lists

This is a discussion on need some help on understanding and using Lists within the C++ Programming forums, part of the General Programming Boards category; k so i have a project that I'm working on and i have to reset a list that i have ...

  1. #1
    Registered User
    Join Date
    Sep 2009
    Location
    california
    Posts
    8

    need some help on understanding and using Lists

    k so i have a project that I'm working on and i have to reset a list that i have created.
    i don't want to use any built in functions.

    i was thinking that i could jump to the top of the list and then deleting each item in the list then make the head (top of list) equal to NULL.

    I'm just not sure how to jump to the head of the list.

    thanks for the help.

  2. #2
    Registered User jdragyn's Avatar
    Join Date
    Sep 2009
    Posts
    92
    keep a pointer to the head of the list separate from whatever pointer you are using to traverse the list. Then set the traversing pointer equal to the head pointer to jump to the head. Just remember to update the pointer to the head of the list whenever the head of the list changes.

Popular pages Recent additions subscribe to a feed

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21