Endian is a feature of the CPU, not the compiler...
Assuming your short
type if 16 bits, and the unsigned chars are 8 bits then the memory layout of a
will be
0x00 0x01
On a bit endian CPU this means that *s
will be 1 (0x0001). On a little endian CPU *s
will be 256 (0x0100).
As an aside, it's not so easy to find big endian CPUs any more. This page has a list of CPU architectures from the last few decades and lists the endianness of each one.