Okay, basic structure for a linked list
typedef struct
{
int i;
myStruct *next; // Pointer to the next node in the linked list
myStruct *previous; // Pointer to the previous node in the linked list
}myStruct;
myStruct *head; // Pointer to the head of the linked list
myStruct *tail; // Pointer to the tail of the linked list
void
GenerateAndAddNewNode(void)
{
myStruct *newNode = new myStruct; // Generate a new node dynamically
if(!head) // If there is no current list
{
head = tail = newNode; // The head and tail of the list now point at the new node
head->previous = NULL; // Which points at nothing
head->next = NULL;
}
else
{
tail->next = newNode; // The tail now points on to the new node
newNode->previous = tail; // Which points back to the tail
newNode->next = NULL; // And on to nothing
tail = newNode; // The tail is advanced to the last node
}
}
Removing a node involves setting up the next and previous pointers of the nodes (if they exist) before and after the node to be deleted then deleting the node with the delete function
Does that help?