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

    const User *curr = head;
    while (curr != NULL) {
        if (strcmp(curr->name, name) == 0) {
            return (User *)curr;
        }
        curr = curr->next;
    }
    return NULL;
}

Return a pointer to the user with this name in the list starting with head. Return NULL if no such user exists.