How can I copy a text file into another? I tried this:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream infile("input.txt");
ofstream outfile("output.txt");
outfile << infile;
return 0;
}
This just ends up leaving the following value in output.txt
: 0x28fe78
.
What am I doing wrong?