Hi all, I'm in need of some help.
I made a simple linked list, but when I try to traverse through it in reverse, I keep getting a "exception error"...can someone shed any light on where I'm going wrong?
Please and thank you

for(int i = 1; i <= 10; i++)
{
current->next = new Node;
current->next->Data = i;
current = current->next; // You went wrong here. You have now dropped your handle on the
// "old" current node without setting the prev pointer of the new node
tail = current->prev; // You don't know where current->prev is pointing.
tail = current;
}

Instead, you should have:

Code:

for(int i = 1; i <= 10; i++)
{
current->next = new Node;
current->next->prev = current; // You NEED this.
current->next->next = NULL; // This would be a good idea too. All pointers should be set
// when the new node is created. Then you can eliminate the
// "current->next = NULL;" line that you had after the end of the loop.
current->next->Data = i;
current = current->next;
tail = current;
}