I red all the questions with the code about the same issue but I can't figure out what is wrong with my code. When I use the command ./generate 1000 50 | ./find 127 I get: Didn't find needle in haystack. What am I doing wrong?
bool search(int value, int values[], int n)
{
if (n < 1)
{
for (int i = 0; i < n; i++)
{
if (values[i] == value)
{
return true;
}
return false;
}
else
{
return false;
}
}
}
When I write make find in the terminator I get the next error:
helpers.c:29:5: error: expected expression
else
^
What am I doing wrong?