int create_user(const char *name, User **user_ptr_add) {

    // if username is too long, return 2
    if (strlen(name) >= MAX_NAME) {
        return 2; // note: we use >= instead of > since strlen does not include the null terminator in its calculation
    }

    User *existing_curr = *user_ptr_add; // setting current element at the start of the user linked list
    // iterating through user list to see if the provided nickname already exists
    while (existing_curr != NULL) {
        if (strcmp(name, existing_curr->name) == 0) {
            return 1; // if any user in the linked list has the same name we return 1
        }
    }

    User *user = malloc(sizeof(User)); // initializing the user object
    if (user == NULL) {
        return -1; // malloc failed, terminate the program by returning -1
    }

    // SETTING THE USER OBJECT ATTRIBUTES

    strcpy(user->name, name);
    strcpy(user->profile_pic, "");
    user->first_post = NULL;
    // for loop to iterate through the friends array to set all its elements to null
    int friend_index;
    for (friend_index = 0; friend_index < MAX_FRIENDS; friend_index++) {
        (user->friends)[friend_index] = NULL;
    }
    user->next = NULL;

    // ADDING THE USER TO THE LIST

    User *creation_curr = *user_ptr_add; // resetting the current element at the start of the user linked list

    if (creation_curr == NULL) {
        *user_ptr_add = user; // if the list is empty, make the user object the first element
    }

    while(creation_curr->next != NULL) {
        creation_curr = creation_curr->next; // iterate through the list until we find the first empty position
    }
    creation_curr->next = user; // place the user object into this first empty position

    return 0;

}
this code is intended to take in a username and a pointer to a linked list. then create a user object check if the username exists in a linked list. If it does not exist in the linked list, create a User object with the username parameter and add it to the end of the linked list parameter