Maybe, I am not that familiar enough to know where that is but I will try. It errors out to a file xthrow.cpp, and this is the line of code in xtrow.cpp:

_CRTIMP2_PURE __declspec(noreturn) void __CLRCALL_PURE_OR_CDECL _Xout_of_range(_In_z_ const char * _Message)
{ // report an out_of_range error
_THROW_NCEE(out_of_range, _Message);

But I am not sure that is what you want. To me it appears that something is going wrong after it reads the last line of text from the file and then wants to start executing "start=end+1" for the last time. I think it wants to continue, but there are return no values and gets a memory error.