Every example I've seen involved file stream objects either hardcodes the filename or when writing to file, merely hardcodes the input.
What I'm trying to do is open a pre-existing text file, have the user type in a file name, and save the data from the opened text file into the user-defined output file.
I have one function that opens the text file and another that creates a new output file. I have a third which reads the contents. I can display it on screen but not save it into the new output file.
Any help would be greatly appreciated.
What I'm trying to do is open a pre-existing text file, have the user type in a file name, and save the data from the opened text file into the user-defined output file.
I have one function that opens the text file and another that creates a new output file. I have a third which reads the contents. I can display it on screen but not save it into the new output file.
Any help would be greatly appreciated.