11-21-2016, 10:15 AM
that's exactly where i'm lost, even with extensive researches.
i must then suppose that the compiler would align automagically bymode to 2 byte to fit alignment of WORD wBitrate and that the C headers use pragma to
force it to be it's "right" alignment (for memory saving i guess)?
as
DWORD dwSampleRate => size 4 bytes offset 0
BYTE byMode => size 1 byte offset 4
WORD wBitrate size 2 bytes, offset should be 5 not 6 (4+1)
i will play with sizeof(i 'm away from my laptop right now) later to understand.
why? the order of the variables does not seem to be important...
Quote:wBitrate offset = 5. Without it would be 6.
i must then suppose that the compiler would align automagically bymode to 2 byte to fit alignment of WORD wBitrate and that the C headers use pragma to
force it to be it's "right" alignment (for memory saving i guess)?
as
DWORD dwSampleRate => size 4 bytes offset 0
BYTE byMode => size 1 byte offset 4
WORD wBitrate size 2 bytes, offset should be 5 not 6 (4+1)
i will play with sizeof(i 'm away from my laptop right now) later to understand.
Quote:>would it be possible to invert bymode and wBitrate
no.
why? the order of the variables does not seem to be important...