I want to do a function that takes two integers and returns a boolean , but when I put the:
return (encontrou);
It gets an error on top of the encontrou
variable. Here is part of my function:
public static bool verificar(int cont, int m1, int m2, int[] Cobertura1, int[] Cobertura2)
{
bool encontrou;
for (int i = 0; i <= cont; i++)
{
if ((m1 == Cobertura1[i]) &
(m2 == Cobertura2[i]) &
(m1 == Cobertura2[i]) &
(m2 == Cobertura1[i]))
{
encontrou = false;
}
else
encontrou = true;
}
return (encontrou);
}