diff --git a/basic_content/sizeof/README.md b/basic_content/sizeof/README.md index 7cfdbc0..afdadc1 100644 --- a/basic_content/sizeof/README.md +++ b/basic_content/sizeof/README.md @@ -119,6 +119,17 @@ class A * long b * 根据字节对齐4+4=8+8+8=24 */ + +/** + * 非作者本人 + * char a + * int b + * short a + * long b + * 在32位机器底下,根据字节对齐应该为char = 1(对齐后为4),int = 4,short = 2(对齐后为4),long = 4 + * 总和应该为16 + */ + class B:A { public: