I know that this question has been asked before, but none of the answers have helped me. I keep getting the "control may reach end of non-void function" error when I try to make find after editing helpers.c.
bool search(int value, int values[], int n) {
if (n<0)
return false;
// TODO: implement a searching algorithm
for (int i = 0; i<n; i++)
{
if (value == values[i])
return true;
if (value != values[i])
return false;
}
}
I have tried making the 'if (value != values[i)' into just else. I have also tried making it into just return false without any if or else. But, I keep receiving the same error.
Thanks in advance for all the help.