So below is my code. As you can see, the first thing I do after declaring variables is open up a file as an ifstream. Sometimes the code runs fine, and sometimes I get a seg