32bit系统内存对齐

来源:互联网 发布:微软人工智能小冰 编辑:程序博客网 时间:2024/06/12 03:45

struct test
{
 char  a;
 int   b;
 char  c;
};

 

struct test

{

short a;

int b;

char c;

}

 

int main()
{
 //practice1();
 cout<<sizeof(struct test)<<endl;

}

 

运行结果都是12。

0 0