This seems pretty simple, but I'm not sure what I'm doing wrong. Thanks in advance for helping!
bool search(int value, int values[], int n)
{
if (n >= 0) {
for (int i = 0; i <= n; i++)
{
if (values[i] == value)
{
return true;
}
else
{
return false;
}
}
}
else
{
return false;
}
}
The error says:
helpers.c:40:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
} ^ 1 error generated. make: *** [helpers] Error 1