Solved
Bit shifting via Visual C++ 5.0
Posted on 1998-07-23
Can anyone explain the reason behind the situation below :
the following code :
#include <stdio.h>
void main()
{
unsigned int x,y;
x = 0xAAAAAAAA;
y = x >> 32;
printf("%X",y)
}
Produces:
AAAAAAAA
Why is it that if I shift a 32 bit variable by 32 bits, I get the same number. If I shift a number, say :
y = 0xFFFFFFFF >> 32
then y=0. ????
if I let x=FFFFFFFF and then do:
y = X >> 31;
y = y >> 1;
THEN I get y=0, but not if I do all the shifting at once.
Any help??????