Answer to Question #218854 in C++ for qwe

Question #218854

write a program to copy content of one file to another file in c++


1
Expert's answer
2021-07-25T08:24:45-0400
#include <iostream>

using namespace std;

freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);

string s;

int main()
{
    getline(cin, s);
    cout << s;
    return 0;
}

Example:
input.txt -> Lorem ipsum dolor sit amet
output.txt -> Lorem ipsum dolor sit amet

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS