struct
{
uint32_t i;
uint32_t i2;
}s;
printf("%p %p", &s.i, &s.i2);
If the example above prints:
0 4
That means that the topmost member into the structure is located at the smaller memory address, and the consequent elements are stored at contiguous addresses in increasing order.
What if the platform endianness is inverted? Would that pattern change? Is this mentioned somewhere in the specification of some C standard?