What is sizeof(struct StructT) equal to?
struct StructT {
    uint64_t fieldOne;
    uint8_t fieldTwo;
In this case, the size of the structure in memory is 16 bytes instead of 9, as one might suppose, because each structure "wants to be aligned" in the array, but the standard requires that the array items be "without holes" between them.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Зарегистрируйся сейчас
или Подпишись на будущие тесты