User *find_user(const char *name, const User *head) {

    User *curr = (User *)head;
    while ((curr != NULL) && (curr->name != name)) {
        curr = curr->next;
    }

    if (curr->name == name) {
        return curr;
    }

    return NULL;
}
to find a user from the linked list starting with the parameter head