You run it on the little-endian platform.
On the little-endian platform, a 32-bit int is stored in memory with the least significant byte at the lowest memory address. Therefore, bits 0-7 are stored at address P, bits 8-15 at address P + 1, bits 16-23 at address P + 2, and bits 24-31 at address P + 3.
In your example: bit 0-7 = 't', bit 8-15 = 's', bit 16-23 = 'e', ββbits 24-31 = 't'
So, the order in which bytes are written to memory: "tset"
If you address memory, and then as separate bytes (unsigned chars), you will read them in the order in which they are written into memory.
source share