I'm trying to create a mask, but when I calculate the value of shift and put it inside a variable I get the wrong result. Look:
#include <stdio.h>
int main(){
int shift = 32 ;
printf("%d\n",shift); //32
int mask = 0xFFFFFFFF << shift;
printf("%x\n",mask); //ffffffff
mask = 0xFFFFFFFF << 32;
printf("%x\n",mask); //00000000
return 0;
}
Someone knows why this is happening?