首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

vc2010的sizeof(time_t)为什么是8,即使在32位下编译?解决方法

2012-04-21 
vc2010的sizeof(time_t)为什么是8,即使在32位下编译?以前sizeof(time_t)都是4,但是为什么现在sizeof(time_

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位时间正好。
[解决办法]
看一下他的定义不就清楚了
[解决办法]
这点小区别没有什么好惊讶的

热点排行