Tag: 字符串转换

如何将st_mtime(从stat函数获取)转换为string或char

我需要将st_mtime转换为字符串格式以将其传递给java层,我尝试使用此示例http://www.cplusplus.com/forum/unices/10342/但编译器会产生错误 从’long unsigned int *’到’const time_t * {aka long int const *}’的无效转换 初始化’tm * localtime(const time_t *)'[-fpermissive]的参数1 我做错了,如何在字符串表示中使用stat函数获取文件的时间。 请帮忙。