I'm trying to do the last part of my assignment and the code works fine, but I have an issue. When I read from a file (that the user inputs the name of), it keeps reading the same line over and over again.
You could force the program to crash when the input file stream goes into an error state. At least then you know if it's the file reading that is to blame, and not the memory leaks.
> If I use cin.ignore() it just stands there waiting for me to press enter,
> getline(cin, line); I assume you mean getline(myFile, line)(?)
That was an example, modify it according to the streams that you are using.