最简单的代码,能够解决最棘手的问题,才是解决工程师的需要:

#include <stdio.h>
#include <time.h>
#include <unistd.h>

int main(void)
{
time_t t;
time(&t);
while(1)
{
    sleep(1);
    printf("Today's date and time: %s", ctime(&t));
}
return 0;
}

 

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2021-08-24
  • 2022-01-30
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-11
  • 2022-01-13
  • 2021-08-06
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案