0

I altered the code in helpers.c in such a way that when the difference between the find value and the "haystack" value equals zero the program returns true.

However find will no longer compile and returns "error in backend: IO failure on output stream". What is the best way to go about debugging the file?

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

    else {
        int i;
        int compare;

        for (i = 0; i < n; i++) {
            compare = value - values[i];

            if (compare == 0) {
                return true;
            }          
        }
    }
    return false;
}
1

I don't really know what you're trying to do exactly here, but your code doesn't seem to be having any errors at all.

If you want to compare the equality of two values, you may write something like this

if (firstValue == secondValue)
{
    // do something
}

EDIT This error occurs when make cannot complete due to disk full condition.

| improve this answer | |

You must log in to answer this question.

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