vc++2008 beta2,默认对齐方式(该为4字节吧)
struct s0 {
char ch;
char* ptr;
union B{
short a, b;
unsigned int c:2, d:1;
} u;
struct s0 *next;
};
struct s1 {
char* ptr;
char ch;
union B{
short a, b;
unsigned int c:2, d:1;
} u;
struct s1 *next;
};
struct s2 {
char ch0;
char* ptr;
char ch;
union B{
short a, b;
unsigned int c:2, d:1;
} u;
struct s1 *next;
};
struct s3 {
char* ptr;
char ch;
union B{
short a, b;
unsigned int c:2, d:1;
};
struct s1 *next;
};
struct s4 {
char ch;
union B{
short a, b;
unsigned int c:2, d:1;
} u;
char* ptr;
struct s1 *next;
};