Using ifstream and ofstream with arrays in C++

Problem solved, thanks guys.
Last edited on
Let me guess. You're getting compiler errors about copy constructors being private, aren't you?
readFile() and writeFile() should take references to streams, not copies (i.e. 'std::ifstream &' and 'std::ofstream &', not 'std::ifstream' and 'std::ofstream'). Otherwise, you're telling the compiler that you want to copy the objects, and std::streams can't be copied.
Yes, I am.

So should I take the inFile.open stuff and outFile.open stuff outta the functions since they were already opened in the int main?

Yes, that too.
When you are talking about std::streams,

Your i.e., are you suggesting that I change my function parameters to ifstream inFile& and ofstream outFile&, or.. something like just ofstream& and ifstream&?
Topic archived. No new replies allowed.