typedef struct node
{
int i;
char s[1];
}b;
typedef struct node
{
int i;
char s[2];
}b;
typedef struct node
{
int i;
char s[5];
}b;
sizeof(b)会不会有不同?
前两个是8后面是12
而
typedef struct node
{
char s[5];
}b;
sizeof(b)为5
有高手能解释一下吗?
{
int i;
char s[1];
}b;
typedef struct node
{
int i;
char s[2];
}b;
typedef struct node
{
int i;
char s[5];
}b;
sizeof(b)会不会有不同?
前两个是8后面是12
而
typedef struct node
{
char s[5];
}b;
sizeof(b)为5
有高手能解释一下吗?
你去c++选项中的结构对齐选项设为1就正常了...