title: How to display real time in c++
body: <p>Can some one tell me how do i display real time in c++. what i mean is that while the program is running you can see the seconds and or minutes counting down like a real clock hanging on the wall</p>
  
  <p>this is what I have: </p>
  
  <pre><code>int main ()
  {
    time_t rawtime; //creates and object of the built in time function
    struct tm * timeinfo; //no idea what this do
  
    time ( &amp;rawtime ); //gets the time from the computer
    timeinfo = localtime ( &amp;rawtime ); //store that time here
  
    //it displays current date and time except time is frozen and not real time
    cout&lt;&lt; "Current local time and date: "&lt;&lt;asctime (timeinfo)&lt;&lt; endl; 
  
  
    system("pause");
    return 0;
  
  }
  </code></pre>