You got the memory layout you expected. However, when you read the memory as a uint32_t
, the system interpreted it according to how it lays out 32-bit values in memory. Your system appears to lay out 32-bit values in 8-bit memory addresses by putting the least significant bytes first.
Say I have a piece of paper with four boxes in it. I can write the number one thousand four hundred and twelve as either "1,4,1,2" or "2,1,4,1". There's no particular reason to prefer one over the other just because humans normally right digits from left to right.
If you're going to place numbers in each of those four boxes yourself and then ask me what four-digit number that represents, you have to know which box I'm using for which digit. You can't just assume I'm using left to right.
Your computer happens to store the least significant bytes at the lower memory addresses. There's no particular reason to prefer one method over the other.