io stream and string class problems

This is a discussion on io stream and string class problems within the C++ Programming forums, part of the General Programming Boards category; Hi
My program is eventually supposed to read in a .cpp file, ask the user if they want to get ...

io stream and string class problems

Hi
My program is eventually supposed to read in a .cpp file, ask the user if they want to get rid of the white space lines and/or single line comments, show the changed file to the screen and then ask if they want to save the file or not. I cannot get the program to get rid of the whitespace or comments. It will complie but I will get a run time error that will crash the program. Any help would be appreciated.