L
Hey Barry,
your comments are true - I've updated my code. However, I want to point out that your last comment related to traversing the list twice confused me a bit!
The variable *current will not be set as a result of the loop to the last node, rather, it will point to NULL!
Simply setting the current->next = item; item->prev = current is not going to work. I believe the while condition should be changed in order to always point to the last item in the list.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.