https://blog.csdn.net/u011288190/article/details/45722925

 

输出麻烦, 改造一下:

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

using namespace std;

int main()
{
    time_t currentTime;
    time(&currentTime);
struct tm *p = localtime(&currentTime); char str[200] = {0}; snprintf(str, 200, "Hour:%d, minit: %d, second: %d", p->tm_hour, p->tm_min, p->tm_sec); cout << str<< endl; }

 

相关文章:

  • 2022-12-23
  • 2021-09-10
  • 2021-12-11
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
猜你喜欢
  • 2022-01-30
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-02-07
  • 2022-03-08
相关资源
相似解决方案