Quote Originally Posted by gfzhang View Post
However, recommends you to use ofstream like this:
Code:
ofstream foutmaster;
foutmaster.open("master.data", ... );
..........
foutmaster.close();
why?

Why not just his:
Code:
ofstream foutmaster("master.data", ... );
// read data, etc.
// when goes out of scope, it will close file automatically.