I want to write a program that reads from three different existing files and writes their contents into a single new output file, making sure to preserve the appearance of the lines as i copy them, allowing the user to specify the name of the output file. The input files are called input1.txt, input2.txt, and input3.txt.
looks like it does that, is there an issue?
I would insert one more end of line into the files after each file is done, though. up to you, do you want a gap between each file (at least to debug it, at first?) or not?
you should close the output file.
you can do it in a lot less code if you use system calls. If this is ALL you need to do, the operating system can do this task and c++ can delegate the work to it. (as can a script or batch file)
windows:
c:\> type file1 > outputfile
c:\> type file2 > outputfile
.. etc
unix, change "type" to "cat". There isnt a dog utility, though.
if the files are exceedingly large (gigabytes), processing it in binary would be more efficient.