#pragma pack

来源:互联网 发布:传奇数据库加载失败 编辑:程序博客网 时间:2024/04/28 15:10
#pragma pack(1) // 字节对齐struct S{char  ch;short sh;int   i;long  l;float f;double d;};inline void TestPack(){printf("%d ", offsetof(S, ch));printf("%d ", offsetof(S, sh));printf("%d ", offsetof(S, i));printf("%d ", offsetof(S, l));printf("%d ", offsetof(S, f));printf("%d ", offsetof(S, d));}


 

原创粉丝点击