| 9 | }; |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | student s = {10, "asd", 'M'}; |
| 14 | cout << sizeof(s.num) << endl; // 4 |
| 15 | cout << sizeof(s.name) << endl; // 10 |
| 16 | cout << sizeof(s.gender) << endl; // 1 |
| 17 | cout << sizeof(s) << endl; // 4 + 20 + 4 字节对齐 |
| 18 | return 0; |
| 19 | } |
nothing calls this directly
no outgoing calls
no test coverage detected