结构体存储分配

来源:互联网 发布:淘宝河北邢台羊绒衫 编辑:程序博客网 时间:2024/06/05 08:44

#include <stdio.h>
int main(){
 struct ALIGN1
 {
  int b;
  char a;
  char c;
 };
 struct ALIGN2
 {
  char a;
  int b;
  char c;
 };
 printf("%d ,%d",sizeof ALIGN1,sizeof ALIGN2);

}

 

输出:8 ,12