部分数据类型所占字节数:
short:2 Byte
int:4 Byte
char:1 Byte
float:4 Byte
double:8 Byte
long:4 Byte
long long:8 Byte
例如:
struct cs
{
short a;
char b;
float c;
};
字节长度:2 (short)+ 1(char) + 4(float) + 1(结构体所占的)= 8 Byte
可以用 sizeof() 验证
部分数据类型所占字节数:
short:2 Byte
int:4 Byte
char:1 Byte
float:4 Byte
double:8 Byte
long:4 Byte
long long:8 Byte
例如:
struct cs
{
short a;
char b;
float c;
};
字节长度:2 (short)+ 1(char) + 4(float) + 1(结构体所占的)= 8 Byte
可以用 sizeof() 验证