数据类型占用的字节数:
char 1
short 2
int 4
long long 8
当我们需要进行内存补齐的时候,是看最大类型然后进行补齐。
struct test{ short a; short b; char c; }; struct test01 { long long a; char b; }; sizeof(test)//大小为6 sizeof(test01)//大小为16