Following are 2 different interpretations:
char c; // 1
struct MyChar { char c; }; // 2
If I do new MyChar[100], will it allocate 100 bytes in all platform ? Adding non-virtual constructor/destructor and/or operators will make any effect on the size of MyChar ?
MyCharmay have unnamed padding bytes afterc, so no, it isn’t guaranteed thatsizeof(MyChar)is1.