首页 > 代码库 > 在C语言中,double long unsigned int char 类型数据所占字节数
在C语言中,double long unsigned int char 类型数据所占字节数
在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 类型数据所占字节数
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。