The purpose of the code is to sort through a data list that has 4 numbers per line separated by spaces and each line ends with a semicolon. I have exactly 40 lines and 4 numbers per line. I also checked the value of i after all of the data had been imported and it was 159. The other thing I tried was break points to see where it was crashing and the error doesn't appear until the last curly bracket of the constructor.
What did solve the problem was instead of multiplying numOfRecs by 4 I changed it to 5 and the error went away, but I don't want to be allocating memory that I won't be using.
That solved the issue.
I'm just starting to learn C++ so I don't really know how to use string streams.
Could you elaborate as to how the code you posted works?