I have created a simple array (not a vector, template, class…nothing of that sort) and I want to use a nice and neat binary search function from the stl to find a particular value in the array and return its index.
Oh yes, the first thing I did is google “binary search function stl.” And voila! So many results. But everything involves Random iterator, template, class, forward iterator etc and since I haven’t learnt the OOPS part of C++ yet (Not that I am shying away from it, but I am just trying to put my Non-OOP knowledge to work), I am unable to comprehend those complicated terms.
Just like how for sorting an array, all I have to have is sort(Arr,Arr+N); with an algorithm header on top, could someone suggest a similar simple away of using the binary search function to find an element and return its index in this simple array of mine?