I\'ve been getting strange compiler errors on this binary search algorithm. I get a warning that control reaches end of non-void function. What does this mean?<
control reaches end of non-void function
It means it's searching for a function that needs to be completed.
else if(val == sorted[mid]) return mid;
so, remove the if() part and modify the code or add an else() at the end which returns an int.