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.
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.
Tags for this Thread