as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write a c++ library that implements a linked list
user
#include<iostream>
using namespace std;

struct node {
    int data;
    struct node *next;
};

// add a new node to the end of the list 
void append(struct node** head_ref, int new_data) 
{ 
    node* new_node = new node; 
  
    node *last = *head_ref;
  
    new_node->data = new_data; 
  
    new_node->next = null; 
  
    if (*head_ref == null) { 
        *head_ref = new_node; 
        return; 
    } 
  
    while (last->next != null) 
        last = last->next; 
  
    last->next = new_node; 
    return; 
} 

// delete the node at a given position 
void deletenode(struct node **head_ref, int position) 
{ 
    if (*head_ref == null) 
        return; 
    struct node *temp = *head_ref; 
    if (position == 0) 
    { 
        *head_ref = temp->next;   
        free(temp);               
        return; 
    } 

   for (int i=0; temp!=null && i<position-1; i++) 
         temp = temp->next; 
  
    if (temp == null || temp->next == null) 
         return; 
  
   struct node *next = temp->next->next; 

   free(temp->next);  
   temp->next = next;  
}
assistant