Quote:
I did use a debugger. The debugger revealed that at some point in the recursion, iRemaining had no value even though iMiddle and i
helperLeft had values. I am referring to the statement: size_t iRemaining = iMiddle - iHelperLeft;
So now you know why the index is out of range.
Now you use the debugger to backtrack and find out how the values got that way - then you can fix it.
As Richard said, you won't find a solution by googling: nobody else has your specific code!
The debugger doesn;'t look at your code and go "it's that bit!" - it gives you information on what is happening so you can work out when you app goes wrong and then look at why. Debugging is a skill, and the only way to get good at it is to use it - so start working with the debugger and see what info you can find.