在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 是无符号的意思。
具体如下表格所占空间字节数
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类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- C语言中double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- VC中double、long、unsigned、int、char类型数据所占字节数
- C语言数据类型占字节数
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- C语言基本数据类型int float double