Код: Выделить всё
struct SN {
uint8_t a;
uint8_t b : 4;
}
Как я могу упаковать структура/объединение в GCC и VC++ побитно, поэтому с точки зрения памяти массив будет выглядеть так:
Код: Выделить всё
[8 bits]
[4+4 bits]
[8 bits]
[8 bits]
[4+4 bits]
[8 bits]
Код: Выделить всё
[8 bits]
[4 bits + 4 bit padding]
[8 bits]
[4 bits + 4 bit padding]
[8 bits]
[4 bits + 4 bit padding]
[8 bits]
[4 bits + 4 bit padding]
Подробнее здесь: https://stackoverflow.com/questions/798 ... gcc-and-vc
Мобильная версия