1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| struct Empty {}; struct Base { int a; }; struct Derived : Base { int b; }; struct Bit { unsigned bit: 1; };
Empty e; Derived d; Base& b = d; [[maybe_unused]] Bit bit; int a[10];
sizeof e sizeof &e sizeof(Bit) sizeof(int[10]) sizeof(a) ((sizeof a) / (sizeof *a)) ((sizeof a) / (sizeof a[0])) sizeof d sizeof b
|