Converting a single linked list to a double linked list

I have created a single linked list that has integers from a file. How do I copy the nodes in the single linked list to a double linked list?

Thanks!
I have something like:

p->next = q->next;
p->back = q;
q->next->back = p;
q->next = p;

But I just don't know how to implement it and make it switch to a double linked list.

Thanks again
Topic archived. No new replies allowed.