首页 > 编程语言 > 详细

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

时间:2014-09-15 16:04:29      阅读:169      评论:0      收藏:0      [点我收藏+]
在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位编译器
char 1byte 1byte 1byte
char *(指针变量) 2byte 4byte 8byte
short int
2byte 2byte 2byte
int
2byte 4byte 4byte
unsigned int
2byte 4byte 4byte
float 4byte 4byte 4byte
double
8byte 8byte 8byte
long
4byte 4byte 8byte
long long
8byte 8byte 8byte
unsigned long 4byte 4byte 8byte

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

原文:http://blog.csdn.net/mhtios/article/details/39291533

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!