int create_user(const char *name, User **user_ptr_add) {
    //check whether the name is too long;
    if (strlen(name) > MAX_NAME - 1){
        return 2;
    }
    //check whether the user already exists and find the previous user of new user
    User *curr = *user_ptr_add;
    while (curr->next != NULL){
        if (strcmp(curr->name, name) == 0){
            return 1;
        }
        curr = curr->next;
    }
    //create new user
    User new_user;
    strcpy(new_user.name, name);
    char profile[MAX_NAME];
    profile[0] = '\0';
    strcpy(new_user.profile_pic, profile);
    new_user.first_post = NULL;
    for (int i = 0; i < MAX_FRIENDS; i++){
        new_user.friends[i] = NULL;
    }
    new_user.next = NULL;
    //put the new_user in the list
    curr->next = &new_user;
    return 0;
}