write a program to copy content of one file to another file in c++
#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
Comments
Leave a comment