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

check here.

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

posted @ 2014-09-19 04:28  zmiao  阅读(106)  评论(0编辑  收藏  举报