Order of fields when using a bit field in C
C standard allows compiler to put bit-fields in any order. There is no reliable and portable way to determine the order. If you need to know the exact bit positions, it is better use plain unsigned variable and bit masking. Here’s one possible alternative to using bit-fields: #include <stdio.h> #define MASK_A 0x00FF #define MASK_B 0x3F00 … Read more