// This code is meant to be run on a laptop or CS homework server, // but you could also try it on the STM32 with appropriate modifications! #include int main(int argc, char* argv[]) { unsigned int x = 0x12345678; // Here is a 4-byte number unsigned int* xp = &x; // Get the address unsigned char* cp = (unsigned char*)xp; // Same address, but only referring to the first byte // Now the question: will we get 0x12 (big-endian) or 0x78 (little-endian)? printf("The first byte is 0x%x\n", *cp); }