I have just implemented binary search on helpers.c and it compiles perfectly, but, when I try to execute find, the program doesn't quit. I tried with ./generate 3 2 | ./find 59797 (because 59797 is one of the numbers on ./generate 3 2), but I always get this:
haystack[0] =
haystack[1] =
haystack[2] =
haystack[3] =
and the programs doesn't give me an output or something, it just stays there until I hit ctrl C. I figured it may be the while loop in the beginning of my code, which is (won't post whole code for academic purposes):
while (values > 0)
{
...
}
PS: at the end of the program (outside the while loop) there is a return false in case nothing in my while loop works.
I looked through pretty much every similar question in here but nothing helped. Does anyone know what to do?