C
Charles Sullivan
I understand different processor hardware may store the bits in a
byte in different order. Does it make a difference in C insofar
as bit-shifting unsigned char variables is concerned?
E.g, if I have
unsigned char x = 1;
is it always true that
(x << 1) == 2
(x << 2) == 4
etc?
Or might I have to reverse the direction of the shift on some
architectures?
(I'm grasping at straws trying to figure out why some C software
written on my i86 system is failing when compiled on another
individual's PPC system.)
Thanks for your help.
Regards,
Charles Sullivan
byte in different order. Does it make a difference in C insofar
as bit-shifting unsigned char variables is concerned?
E.g, if I have
unsigned char x = 1;
is it always true that
(x << 1) == 2
(x << 2) == 4
etc?
Or might I have to reverse the direction of the shift on some
architectures?
(I'm grasping at straws trying to figure out why some C software
written on my i86 system is failing when compiled on another
individual's PPC system.)
Thanks for your help.
Regards,
Charles Sullivan