# expected output not standard error

In pset3's find. I have implemented Binary search. Everything works fine when I test it. But when I test it with check50, the last test fails saying: `\ expected output, not standard error of "/opt/sandbox50/bin/run.sh: line 31: 176..."`.

When I test it using the same cases everything works fine as it should.

And then this happens when using check50

EDIT: here is my binary search code. I will remove it after some time or if I get a fix.

``````bool search(int value, int values[], int n)
{
// base condition

// check if only one left and equal to required value
if (n == 1 && value != values[0])
{
return false;
}
// if odd and middle
else if (n%2 == 1 && values[(n+1)/2] == value)
{
return true;
}
// else if even and middle
else if (n%2 == 0 && (value == values[(n/2)-1] || value == values[(n/2)]))
{
return true;
}
// if odd
else if (n%2 == 1)
{
if (value < values[(n+1)/2])
{
return search(value, values, ((n+1)/2));
}
else if (value > values[(n+1)/2])
{
for (int i = 0; i < (n+1)/2; i++)
{
values[i] = values[((n+1)/2)+1+i];
}
return search(value, values, ((n+1)/2));
}
}
// if even
else if (n%2 == 0)
{
if (value < values[(n/2)-1] || value < values[n/2])
{
return search(value, values, (n/2)-1);
}
else if (value > values[(n/2)-1] || value > values[n/2])
{
for (int i = 0; i < (n/2); i++)
{
values[i] = values[(n/2)+i];
}
return search(value, values, (n/2));
}
}
return false;
}
``````
• Anyone? No one? Aug 12 '15 at 6:31
• I guess it's because no one has seen the issue :( having said that, the /opt/sandbox50/bin/run.sh does not exist on my appliance, so I assume its from the system that the check50 runs from. Why yours should error like that I am not sure. Perhaps emailing one of the course staff might elicit a better response. Aug 15 '15 at 21:20
• How can I email someone from staff and should I also email my code? Aug 16 '15 at 1:10
• Try emailing heads@cs50.harvard.edu for advice on how to proceed in locating help - I wouldn't send the code (unless asked) but rather a link to here. An alternative would be to seek help via the Facebook community - someone there may have seen the same issue - facebook.com/groups/cs50 Aug 16 '15 at 12:06