J
junky_fellow
Hi,
Consider following piece of code:
int i = 0x12345678;
char c;
c = i;
printf("0x%x\n",c);
What value will be printed ?
As per K&R, longer integers are converted to shorter ones by dropping
the higher order bits. So, value printed should be "0x78".
However, my question is that can this value be different on machines
with different endianness ?
thanks a lot for any help ...
Consider following piece of code:
int i = 0x12345678;
char c;
c = i;
printf("0x%x\n",c);
What value will be printed ?
As per K&R, longer integers are converted to shorter ones by dropping
the higher order bits. So, value printed should be "0x78".
However, my question is that can this value be different on machines
with different endianness ?
thanks a lot for any help ...