I am not sure where I have gone wrong with helpers.c. I passed all check50 tests except for 2 under "doesn't find". My code is below:
code removed
What check50 returns is as follow:
:) helpers.c exists.
:) helpers.c compiles.
:) finds 28 in {28,29,30}
:) finds 28 in {27,28,29}
:) finds 28 in {26,27,28}
:) finds 28 in {27,28,29,30}
:) finds 28 in {26,27,28,29}
:) finds 28 in {25,26,27,28}
:( doesn't find 28 in {25,26,27}
expected exit code 1, not 0
:( doesn't find 28 in {25,26,27,29}
expected exit code 1, not 0
:) finds 28 in {30,27,28,26}
Any help will be greatly appreciated!
EDIT: false positive due to return true statement at the end of each if/else if statement. But "return true" statement should only be included after search() checks that target== mid ie the end of the implementation (the point of a function that returns a boolean). Also, setting up a variable to check the array index is key to solving this pset (at least for me).