码迷,mamicode.com
首页 > 其他好文 > 详细

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

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

标签:blog   http   ar   for   log   c   ef   size   r   

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?

标签:blog   http   ar   for   log   c   ef   size   r   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!