Rookie2

1st Edition

导航

2012年11月17日 #

数据对齐问题

摘要: #includetypedef struct node1{ short s; // 2 bytes double d; // 8 bytes char c; // 1 bytes}A1;typedef struct node2{ char c; // 1 bytes short s; // 2 bytes double d; // 8 bytes}A2;void main(){ printf("%d\n", sizeof (A1)); // 结果 24 printf("%d\n", sizeof (A2)); // 结果 16 ... 阅读全文

posted @ 2012-11-17 12:38 Rookie2 阅读(205) 评论(0) 推荐(0) 编辑