各位大神帮忙分析一下,这个字节对齐问题怎么理解?
#include<stdio.h>main()
{
typedef struct T1
{
int j;
char ch;
struct
{
float u;
short i;
};
short int e;
char xx[11];
} TYPE;
struct T2
{
char ch;
double h;
short int e;
char xx[11];
};
printf("T1 size = %d\n",sizeof(TYPE));
printf("T2 size = %d\n",sizeof(struct T2));
}
结果:
T1 size = 32
T2 size = 32
各位大神帮忙分析一下,这个字节对齐问题怎么理解?