struct A { char c; double d; } a;
sizeof a = 16
sizeof a = 12
为什么他们不同?我认为它应该是16,gcc4.6.3是否做了一些优化?
c c++ sizeof
c ×1
c++ ×1
sizeof ×1