I'm trying to pass an ofstream object to another function. This is my attempt here (simplified to what matters):
I have also tried pointers but they failed for me too (I'm not 100% comfortable with pointers yet). So how would I go about doing this?Code:#include <fstream> inline void FunctionTwo(ofstream Bfile) { bfile<<"test"; } main() { ofstream Afile("test.txt", ios::trunc); functiontwo(Afile); }
Thanks in advance!