gpt4 book ai didi

c - time_t 最终的 typedef 是什么?

转载 作者:IT老高 更新时间:2023-10-28 12:20:22 25 4
gpt4 key购买 nike

我搜索了我的 Linux 机器并看到了这个 typedef:

typedef __time_t time_t;

但我找不到 __time_t 定义。

最佳答案

time_t Wikipedia article文章对此有所了解。底线是 time_t 的类型在 C 规范中是没有保证的。

The time_t datatype is a data type in the ISO C library defined for storing system time values. Such values are returned from the standard time() library function. This type is a typedef defined in the standard header. ISO C defines time_t as an arithmetic type, but does not specify any particular type, range, resolution, or encoding for it. Also unspecified are the meanings of arithmetic operations applied to time values.

Unix and POSIX-compliant systems implement the time_t type as a signed
integer
(typically 32 or 64 bits wide) which represents the number of seconds since the start of the Unix epoch
: midnight UTC of January 1, 1970 (not counting leap seconds). Some systems correctly handle negative time values, while others do not. Systems using a 32-bit time_t type are susceptible to the Year 2038 problem.

关于c - time_t 最终的 typedef 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/471248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com