//#pragma pack(1)
struct test{
int a,b;
double c;
char d;
}
//#pragma pack()
不加注释(默认对齐):
sizeof(test) = 24
加注释(1字节对齐):
sizeof(test) = 24
//#pragma pack(1)
struct test{
int a,b;
double c;
char d;
}
//#pragma pack()
不加注释(默认对齐):
sizeof(test) = 24
加注释(1字节对齐):
sizeof(test) = 24