0

My code is going through check50 okay, but when I try to check it manually it doesn't seem to be able to find the needle in the haystack. I can't figure out why that is happening that's why I'm hoping any of you guys gives me an explanation.

The code:

bool search(int value, int values[], int n)
{
    // TODO: implement a searching algorithm
    if(n <= 0)
    {
        return false;
    }

    for(int i = 0; i < n; i++)
    {
        if(values[i] == value)
        {
            return true;
        }
    }
    return false;
}
0

I just had to recompile find.c. Problem solved.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .