How to display real time in c++

前端 未结 6 927
梦如初夏
梦如初夏 2021-01-24 14:04

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 h

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-24 14:46

    Add a system("cls");

    Like this:

     time_t rawtime;
     struct tm* timeinfo;
     while(true)
     {
     system("cls");
     time(&rawtime);
     timeinfo=localtime(&rawtime);
     cout<<"Time : "<

提交回复
热议问题