int delete_user(const char *name, User **user_ptr_del) {
    User* curr = *user_ptr_del;
    User* prev = NULL;
    int found = 0;
    // iterate through the list
    while (curr != NULL){
        // check if the curr is pointing to the user to be deleted
        if(strcmp(curr->name, name) == 0){
            // check if the user to be deleted is the first user
            if (curr == *user_ptr_del){
                *user_ptr_del = curr->next;
            }
            else{
                prev->next = curr->next;
            }
            found = 1;
            free(curr);
            break;
        }
        // check if curr is friends with the user to be deleted
        else{
            for (int i = 0; i < MAX_FRIENDS; i++){
                if (curr->friends[i] == NULL){
                    break;
                }
                if (strcmp(curr->friends[i]->name, name) == 0){
                    curr->friends[i] = NULL;
                }
            }
            curr = curr->next;
        }
        
    }
    if (found == 0){
        return 1;
    }
    return 0;
}
/*
 * Make a new post from 'author' to the 'target' user,
 * containing the given contents, IF the users are friends.
 *
 * Insert the new post at the *front* of the user's list of posts.
 *
 * 'contents' is a pointer to heap-allocated memory - you do not need
 * to allocate more memory to store the contents of the post.
 *
 * Return:
 *   - 0 on success
 *   - 1 if users exist but are not friends
 *   - 2 if either User pointer is NULL
 */