title: How to overwrite stdout in C
body: <p>In most modern shells, you can hit the up and down arrows and it will put, at the prompt, previous commands that you have executed.  My question is, how does this work?!</p>
  
  <p>It seems to me that the shell is somehow manipulating stdout to overwrite what it has already written?</p>
  
  <p>I notice that programs like wget do this as well.  Does anybody  have any idea how they do it?</p>