您的位置:首页 > 编程语言 > C语言/C++

在C语言中,double long unsigned int char 类型数据所占字节数

2014-09-15 14:19 344 查看
在C语言中,double long unsigned int char 类型数据所占字节数和机器字长及编译器有关系:所以,int,long
int,short int的宽度都可能随编译器而异。但有下面几条原则(ANSI/ISO制订的):
1 sizeof(short int)<=sizeof(int)
2 sizeof(int)<=sizeof(long int)
3 short int至少应为16位(2字节)
4 long int至少应为32位。
unsigned 是无符号的意思。
具体如下表格所占空间字节数
16位编译器32位编译器64位编译器
char1byte1byte1byte
char *(指针变量)2byte4byte8byte
short int2byte2byte2byte
int2byte4byte4byte
unsigned int2byte4byte4byte
float4byte4byte4byte
double8byte8byte8byte
long4byte4byte8byte
long long8byte8byte8byte
unsigned long4byte4byte8byte

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐