title: Binary search for insert char string. Where is the bug?
body: <p>I have array of strings. I must find one char string in array of strings by binary search algoritm. If there is this one string then function must return position and return true otherwise this function must return position for insert string in array and false.
  I have somewhere bug, but I dont know where ((</p>
  
  <p>Example:</p>
  
  <pre><code>bool Binary_search ( char * arr_strings[], int &amp; position, const char * search_string )
  {
      int start = 0 ;
      int end = 10 - 1; // arr_strings [10]
      int for_compare;
      int middle;
  
      while ( start &lt;= end )
      {
          middle = ( start + end ) / 2;
          for_compare = strcmp ( arr_strings[middle], search_string  );
  
          if ( for_compare &gt; 0 )
          {
              start = middle + 1;
          } 
          else if ( for_compare &lt; 0 )
          {
              end = middle - 1;
          }
          else
          {
              // if search_string is found in array, then function return position in array of strings and return true
              position = middle;
              return true;
          }
      }
      // if search_string is not found in array, then function must return position for insert string and return false 
      position = middle;
      return false;
  }
  </code></pre>