Consider uint32_t n = 0x12345678; it stores in BE machine or LE machine, like the picture shows; now I have a structure defined like this
struct DATA {
uint32_t a : 24;
uint32_t b : 8;
};
int main() {
struct DATA data;
data.a = 0x123456;
data.b = 0x78;
return 0;
}
How does it store in memory?

Many possibilities:
int,unsigned,boolwell defined for bit-fields.Good code should not care how it is stored in memory.
If code really needs a certain order, use an array of
uint8_tinstead of a bit-field.Note: many compilers will not store a
uint32_ton an odd boundary as in the example.