So from the title. I'm still pretty wonky on the limitations of file streams. However is the following possible, given
ofstream myfile;
myfile.open ("example.txt");
while(int i=0; i<1000;i++){
functionfoo(i);
}
myfile.close();
and inside functionfoo we have
myfile << object_1;
//some other computations, essentially a placeholder
or should I open and close the filestream inside functionfoo and pass the file name?