This code does not make much sense, the question does less.
You are not passing a vector, it is passing a single value. If you want to pass a vector do this and treat it, but everything indicates that just passing the value itself, and this is correct.
What is wrong is the function's internal code. First, that relational comparison with a double
number does not always work, it has no exactness. Second you are putting a value in resposta
and this variable does not even exist. so the compiler should be reporting this. If this is the variable neither is needed.
Even if you declare a variable need to initialize with an invalid value. What would he be? 0? A negative? A NaN? Another thing? Then you would have to change the return type.
To tell the truth maybe it should only return true or false, or even that since the code is too simple. No matter what comes back if you have to filter something on main()
you have to have if
there too, otherwise it even works as long as you choose a value that will be invalid, but it will print normally if you do not have a filter .
We can not know exactly what the code should do, so it is not possible to help more than this, but the error is this that I have demonstrated.