how to create files named with current time?

前端 未结 4 474

I want to create a series of files under \"log\" directory which every file named based on execution time. And in each of these files, I want to store some log info for my p

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-15 02:56

    Sounds like you have mostly solved it already - to create a file like you describe:

    char filename[256] = "log/";
    timeStamp( filename );
    f = fopen( filename, "a" );
    

    Or do you wish do do something more?

提交回复
热议问题