普通类型在内存中存储是按最大的内存地址去存储值 ,而struct中的类型是按顺序给内存地址赋值,是有这个区别吗?
int a =1; 模拟地址:0xfac8,0xfac7,0xfac6,0xfac5; int b=5; 模拟地址:0xfac4,0xfac3,0xfac2,0xfac1.
struct Person
{
int a; 模拟地址:0xfac0,0xfac1,0xfac2,0xfac3;
int b; 模拟地址:0xfac4,0xfac5,0xfac6,0xfac7.
}
是这个意思吗? |
|