The best way's to think about it is that head and tail will point to the first and last node, respectively, in your list. The default constructor should make them NULL. When adding a node, you have to adjust the head and tail pointers to point to the correct node (if adding to the front, have head point to it, if adding to the rear, have tail point to it). Each node pointer of a node (next and last) should point to the correct nodes. The current node's next should point at the node next in line while the current node's last should point to the previous node.
I do not know how to implement a double-linked list with using this structure node. I think it is impossible to do. To implement a double-linked list the structure node should look the following way
1 2 3 4 5 6
struct node
{
int data;
node *next;
node *prev;
};
Wrong names mean wrong code. Wrong words in a sentence give another meaning of the sentence.
So it is very important to use right names that others could understand what you mean.
I have a better opinion about the author of the thread than you have and I think he is clever enough to understand the difference in his notation and main.