line 300 (*line.end() == '1') runtime crash

it's a run-time error since you can't deference a string.end() since it's not a position of the string.