Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
In C++. Create a function that reverses the lines in a file and outputs it into a new file. Reverse LINES of file, NOT STRINGS
In C++.
Create a function that reverses the lines in a file and outputs it into a new file. Reverse LINES of file, NOT STRINGS of file .
INPUT FILE EXAMPLE:
Hello there Foolish Greetings friend Bold one
OUTPUT FILE: (Reverse Lines)
Bold one Greetings friend Foolish Hello there
//Declare Function
void ReverseLines(ifstream &file);
//Example main function
int main()
{
ifstream file; string userFile;
cin >> userFile;
...
}
// Reverse lines function
void ReverseLines(ifstream &file) { ofstream outFile; outFile.open("Output.txt");
ANSWER HERE ]
Thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started