title: How to limit the log size in c++?
body: <p>In my application i am creating log file of size 5kb .If i exceeds 5 kb of file size , I have to overwrite the old contents with the help of new contents.</p>
  
  <p>If you have any ideas just share with me.</p>
  
  <p>I also need implementation of this technique in c++</p>
  
  <p>I provide some example</p>
  
  <p>Initially the file look like this</p>
  
  <p>sample.txt</p>
  
  <p><strong>sample application text
  sample</strong></p>
  
  <p>Assume the above sample text file exceeds 5kb then i added <strong>new</strong> in the source.txt then the file should be like this.</p>
  
  <p>sample.txt</p>
  
  <p><strong>new sample application text 
  sam</strong></p>
  
  <p>Regards,
  Karthik</p>