A copy file Function

#include<iostream>
#include<fstream>
using namespace std;
void copyRead(ifstream inFile, ofstream oFile) {
string data;
for (int i = 0; inFile.eof()!= true; i++) {
data += inFile.get();
}
data.erase(data.end()-1);
oFile << data;
}

int main() {
ifstream copyFile;
ofstream revFile;
revFile.open("revenues.txt");
copyFile.open("Copy_Read.txt");
copyRead(copyFile, revFile);
return 0;

}
/*
I tried to get this to work but I got an error that said "use of deleted function"
Streams can't be copied so you need to pass them by reference.
http://www.learncpp.com/cpp-tutorial/73-passing-arguments-by-reference/
Topic archived. No new replies allowed.