![](https://img-my.csdn.net/uploads/201204/22/1335098578_9151.png)
![](https://img-my.csdn.net/uploads/201204/22/1335099155_5966.png)
![](https://img-my.csdn.net/uploads/201204/22/1335098618_2568.png)
![](https://img-my.csdn.net/uploads/201204/22/1335099266_6097.jpg)
#include<stdio.h>
#include<stddef.h>
int main()
{
struct ALIGN
{
char a;
int b;
char c;
};
struct ALIGN1
{
int b;
char a;
char c;
};
printf(" sizeof(struct ALIGN) =%d\n",sizeof(struct ALIGN) );
printf("offsetof(struct ALIGN, a) = %d\n", offsetof(struct ALIGN, a));
printf("offsetof(struct ALIGN, b) = %d\n", offsetof(struct ALIGN, b));
printf("offsetof(struct ALIGN, c) = %d\n", offsetof(struct ALIGN, c));
printf(" sizeof(struct ALIGN1) =%d\n",sizeof(struct ALIGN1) );
printf("offsetof(struct ALIGN1, b) = %d\n", offsetof(struct ALIGN1, b));
printf("offsetof(struct ALIGN1, a) = %d\n", offsetof(struct ALIGN1, a));
printf("offsetof(struct ALIGN1, c) = %d\n", offsetof(struct ALIGN1, c));
getchar();
return 0;
}![](https://img-my.csdn.net/uploads/201204/22/1335099204_2127.png)