<分区>
我是 C/linux 的新手。 man time_t
不成功。我想弄清楚 time_t
类型到底是什么?当我将 const int
分配给变量类型 time_t
时就可以了,如下所示:
time_t =4;
似乎这种类型只是某些数字类型的别名。但是我不明白这是什么类型?
<分区>
我是 C/linux 的新手。 man time_t
不成功。我想弄清楚 time_t
类型到底是什么?当我将 const int
分配给变量类型 time_t
时就可以了,如下所示:
time_t =4;
似乎这种类型只是某些数字类型的别名。但是我不明白这是什么类型?
最佳答案
是的,它通常是一个别名,但它是 C/C++ 中的标准类型。它不仅可以在 Linux 中使用。
http://www.cplusplus.com/reference/ctime/time_t/
time_t
Time type
Alias of a fundamental arithmetic type capable of representing times, as those returned by function time.
For historical reasons, it is generally implemented as an integral value representing the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC (i.e., a unix timestamp). Although libraries may implement this type using alternative time representations.
Portable programs should not use values of this type directly, but always rely on calls to elements of the standard library to translate them to portable types.
关于c++ - linux中的time_t类型是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23585495/