首页 > 其他 > 详细

Why isn't sizeof for a struct equal to the sum of sizeof of each member?

时间:2014-09-19 05:31:25      阅读:207      评论:0      收藏:0      [点我收藏+]

check here.

Basically the compiler will insert unused memory into a structure so that data members are optimally aligned for better performance.

Why isn't sizeof for a struct equal to the sum of sizeof of each member?

原文:http://www.cnblogs.com/miaoz/p/3980512.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!