Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Create a decision tree for Problem 12.

Answered: 1 week ago