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?
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?
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.
gg