Question about double linked list nodes

What does this line of code do in words?

temp-> next-> prev = temp

Kinda confused.
temp-> next-> prev = temp

It is telling us to move the node one step forward, then one step backward. Then you assign temp to the node itself.
temp->next-> prev = temp

temp->next gives us the next node in the list after temp.
temp->next->prev gives us the previous pointer of the next node in the list after temp.

So the whole thing means: Assign temp to the previous pointer of the next node in the list after temp.
and here's an example of temp-> next-> prev = temp being used to insert data in order into a doubly linked list - line 78 in link below:
http://www.cplusplus.com/forum/beginner/210745/#msg988500
Topic archived. No new replies allowed.