c++用时间作为文件名保存

    time_t nowtime = time(NULL);
    struct tm *p;
    p = gmtime(&nowtime);
    char tmp[64];
    sprintf(tmp, "%d-%d-%d-%d-%d-%d.tif", 1900 + p->tm_year, 1 + p->tm_mon, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec);
    Sleep(1000);//为了保存图片
    string s_file_save = tmp;
    cv::imwrite(s_file_save, dst1);

猜你喜欢

转载自blog.csdn.net/a573233077/article/details/82252557