[cs13001] FW: CS I Lab 11 Test Code
Mikhail Nesterenko
mikhail at cs.kent.edu
Tue Nov 4 18:51:16 EST 2014
>
> I am currently working on my code for lab 11 Objects with
> Dynamically Allocated Members. In the test code the following lines
> appear:
>
> if (a1.check(1) != -1) // check() returns -1 if number not present
> cout << "1 is not present in the array" << endl;
>
> if (a1.check(5) != -1)
> cout << "5 is not present in the array" << endl;
>
> If the check runs correctly then the index is returned, this makes
> (index != -1) true and then it prints that 1 is not in the array,
> even though the check returned that it was. Should the function
> print that 1 is in the array instead of it is not? Thank You
It is a typo. I have just removed the "not" from the test code.
Thanks,
--
Mikhail
More information about the cs13001
mailing list