title: carriage return not working in xcode console c++
body: <p>I want to output the time and loop it so the time is constantly being updated without outputting the same line again and again so I thought id overwrite the line by using the carriage but it doesn't seem to work and I don't know why, is it to do with Xcode??  I have previously read other posts on stack overflow regarding \r and tried to adapt the answers to my code but none of the solutions seemed to work nor are they related to ios/Xcode. I am also assuming that the problem may have something to do with the Xcode console, being as how it is not a terminal (however I am not to sure)</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;time.h&gt;
  using namespace std;
  int main(int argc, const char * argv[]) {
      //Loop Forever
      for(;;){
          time_t rawtime;
          struct tm * timeinfo;
          time ( &amp;rawtime );
          timeinfo = localtime ( &amp;rawtime );
          cout &lt;&lt; "The current date/time is: " &lt;&lt; asctime(timeinfo) &lt;&lt; "\r";
      }
      return 0;
  }
  
  
  output:
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  
  The current date/time is: Fri Feb 10 17:20:43 2017
  </code></pre>