Question: I need the C++ code for the question I have posted below. I have already submitted my own code that works perfectly fine for the
I need the C++ code for the question I have posted below. I have already submitted my own code that works perfectly fine for the problem, but my teacher claims I am not allowed to use that method. I am a little stumped as to how to solve it using a different method. I will insert my previous code and my teacher's comments as reference, under the problem.
Thank you for your help in advance.


Here is the code I previously submitted:

E8.7 Write a program that reads each line in a file, reverses its lines, and writes them to another file. Suppose the user specifies input.txt and output.txt when prompted for the file names, and input.txt contains the lines Mary had a anb Its fleec And everywhere that Mary went The lamb was sure to go e was white as snow After the program is finished, output.txt should contain The lamb was sure to go And everywhere that Nary went Its fleece was white as snow Mary had a little lanb
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
