- 论坛徽章:
- 0
|
两台机器,前者32位,后者64位,测试了以下数据类型的长度:
前者:
int:4,long:4,long long:8
后者:
int:4,long:8,long long:8
不是说int会变吗,为何变得是long?
The common programming model for existing 32-bit Unix stystems is caled the ILP32 model,denoting that integers, long integers and pointers occupy 32 bits. The model that is becoming most prevalent for 64-bit Unix systems is called LP64 model, meaming only long integers and pointers require 64 bits.
至于还有如果要写个通用的程序,订死必须用4个或8个字节的数据类型,在不需要重新编码编译的前提下,该如何处理这种变化?
赞同楼上的观点
不过楼主要求不重新编译是不行的吧
[ 本帖最后由 zhuhefang2006 于 2008-4-15 10:15 编辑 ] |
|