摘要: 认识字节对齐之前,假定int(4Byte),char(1Byte),short(2Byte) 认识字节对齐 先看段代码: sizeof(Data1)和sizeof(Data2)分别表示Data1和Data2内存占用字节数,输出结果不一样是因为编译时对Data1和Data2做了不同的字节对齐。Data 阅读全文
posted @ 2019-05-27 17:10 蜗牛201 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 认识字节对齐之前,假定int(4Byte),char(1Byte),short(2Byte)认识字节对齐先看段代码:struct Data1{char a;int b;short c;};struct Data2... 阅读全文
posted @ 2019-05-27 17:06 蜗牛201 阅读(121) 评论(0) 推荐(0) 编辑