Insert a value into the correct position of an array

The thing is that the code I put above is just a part of the whole code I have to submit for homework. I only showed this part because I don't have a problem with the other parts. So, in the assignment, I ask the user to enter a value to search for in the array. That's why I put BinarySearch as a bool. See here:

 int value;
 cout << "Enter a value to search for in the array." << endl;
 cin >> value;
 int index = -1;
 bool found = BinarySearch(NumArray, NumArraySize, value, index);
 if (found)
 {
     cout << "The value is found in index # " << index;
 }
 else
 {
     cout << "Value was not found in array.";
 }
 cout << endl;

If I make BinarySearch an int, then I have to return index for both the index being found and the index not being found, which will make the statement say the Value was found in an index when it wasn't actually found. See here:

int BinarySearch (int NumArray[], int & NumArraySize, int value, int& index)
{
    int first = 0;
    int last = NumArraySize - 1;
    int mid;

    while (first <= last)
    {
        mid = (first + last) / 2;

        if (value == NumArray[mid])
        {
            index = mid;
            return index;
        }

        else if (value < NumArray[mid])
        {
            last = mid - 1;
        }
        else if (value > NumArray[mid])
        {
            first = mid + 1;
        }
    }

    if (NumArray[mid] < value)
    {
        index = mid + 1;
    }
    else
    {
        index = mid;
    }
    return index;

}
/r/learnprogramming Thread Parent