读书人

vc2010的sizeof(time_t)为什么是8,即使

发布时间: 2012-04-21 14:34:44 作者: rapoo

vc2010的sizeof(time_t)为什么是8,即使在32位下编译?
以前sizeof(time_t)都是4,但是为什么现在sizeof(time_t)在vc2010下面变成了8,哪怕我是在32位操作系统下面编译。

printf("%ld %ld\n", sizeof(time_t), sizeof(size_t));
打印8 4

[解决办法]
time_t (__int64 or long integer)
Represents time values in mktime, time, ctime, _ctime32, _ctime64, _wctime, _wctime32, _wctime64, ctime_s, _ctime32_s, _ctime64_s, _wctime_s, _wctime32_s, _wctime64_s, ctime, _ctime32, _ctime64, _wctime, _wctime32, _wctime64 and gmtime, _gmtime32, _gmtime64. The number of seconds since January 1, 1970, 0:00 UTC.
If _USE_32BIT_TIME_T is defined, time_t is a long integer. If not defined, it is a 64-bit integer.
[解决办法]
32位时间快到期了。64位时间正好。
[解决办法]
看一下他的定义不就清楚了
[解决办法]
这点小区别没有什么好惊讶的

读书人网 >VC/MFC

热点推荐