Hello.
I want my function to take 'fstream' object as an input, so the program looks like this:
But I get the following error: 'std::ios_base::ios_base(const std::ios_base&)' is private|Code:#include <fstream> using namespace std; void test(fstream a){ a.open("test2.txt"); a << "123" << endl; a.close(); } int main(){ fstream a; test(a); return 0; }
Please help to make it work.