i got this function
#define LITTLE_ENDIAN 0
#define BIG_ENDIAN 1
int i = 1;
char *p = (char *) &i;
if (p == 1) // Lowest address contains the least significant byte
I understand the difference between little and big endian and their definition. However, i don't get the why author need to use
char *p = (char*) &i; <--- why need to convert to char pointer type?
and compare condition p ==1
Thanks for your help and patience.