mercredi 9 décembre 2015

Module testing for a function to find in array

I have a function to check if an number e is exists in an array a[n].

bool check(int e, int a[n]){
    int i = 0;
    bool exist = false;
    while(i < n){
        if(a[i] == e)
        {
            exist = true;
            break;
        }
        i++;
    }
    return exist;
}

I want to make a Module testing document for this function, to determine if it was right or wrong. What have I do?

Aucun commentaire:

Enregistrer un commentaire