title: C++ remove trailing new line from text file
body: <p>Is there a way in C++ to remove/trim a trailing new line from a text file?</p>
  
  <p>For example</p>
  
  <pre><code>content content
  content content
  content content
  &lt;- this line in the text file is empty and needs to go -&gt;
  </code></pre>