title: Read from file, clear it, write to it
body: <p>I'm trying to read data from a text file, clear it, and then write to it, in that order using the <code>fstream</code> class.</p>
  
  <p>My question is how to clear a file after reading from it. I know that I can open a file and clear it at the same time, but is there some function I can call on the stream to clear its contents?</p>