My first suggestion is that you stop opening and closing files all over the place. I'd recommend you open the files in main(), checking for successful opening, and then pass that open stream instance into the functions that require them.
I'd also recommend that you not have a pointer to a stream in your class, in fact I don't recommend even an instance of a stream in your class.
Lastly for now I would recommend that you not close your streams, let the class destructor close the stream when it goes out of scope. As it is right now you appear to be closing a file before you're done with it. And until you get your program working I would stop erasing the input file and just save the changes to another file.