#include<stdio.h>
#include<stdlib.h>
int main(){
int j;
j = 1<<31;//it is ok, j = -2147483648, 32 bits long
j = 1<<32;//warning: left shift count >= width of type
printf("%d/n",j);
return 0;
}
that is to say, 32 is assigned of 32 bits.
Always aware the data types!
shift is fater than * and /
#include<stdlib.h>
int main(){
int j;
j = 1<<31;//it is ok, j = -2147483648, 32 bits long
j = 1<<32;//warning: left shift count >= width of type
printf("%d/n",j);
return 0;
}
that is to say, 32 is assigned of 32 bits.
Always aware the data types!
shift is fater than * and /