Using Visual Studio 2017, the following gives...
struct AAA // 15 bytes
{
double d;
short s;
char a1;
char a2;
char a3;
char s4;
char s5;
};
struct BBB
{
AAA d;
char a4;
};
int main()
{
std::cout << sizeof(AAA) << "\n"; // gives 16
std::cout << sizeof(BBB) << "\n"; // gives 24
getchar();
return 0;
}
The Question is... how do I get sizeof(BBB) to be 16.