Binary Search a 1D array in C++