So I saw a few example on how the endianness of an architecture could be found. Let\'s say we have an integer pointer that points to an int data type. And let\'s say the int
Since pointers are strongly typed, shouldn't a character pointer strictly point to a char data type?
This is kind of undefined behavior - but such that most sane implementations will do what you mean. So most people would say ok to it.
And what's up with printing with %d?
Format %d expects argument of type int, and the actual arg of type char is promoted to int by usual C rules. So this is ok again. You probably don't want to use %c since the content of byte pointed by p may be any byte, not always a valid text character.