title: C++ find size of ofstream
body: <p>I have code that currently does something like the following:</p>
  
  <pre><code>ofstream fout;
  fout.open("file.txt");
  fout&lt;&lt;"blah blah "&lt;&lt;100&lt;&lt;","&lt;&lt;3.14;
  //get ofstream length here
  fout&lt;&lt;"write more stuff"&lt;&lt;endl;
  </code></pre>
  
  <p>Is there a convenient way to find out the length of that line that is written at the stage I specified above? (in real life, the int 100 and float 3.14 are not constant and can change). Is there a good way to do what I want?</p>
  
  <p>EDIT: by length, I mean something that can be used using fseek, e.g.</p>
  
  <pre><code>fseek(pFile, -linelength, SEEK_END);
  </code></pre>