Pass struct as function parameter