Hello.
I want my function to take 'fstream' object as an input, so the program looks like this:
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;
}
But I get the following error: 'std::ios_base::ios_base(const std::ios_base&)' is private|
Please help to make it work.