0x1>>1 하면 0 이 답이냐?  -214783648이 답이냐?

 

 

#include <stdio.h>

int main(void)
{

 size_t a = 0x80000000;
 int b = 0x80000000;
 int c = 0x1;

 printf("%d\n", (a >> 32));
 printf("%d\n", (a >> 31));
 printf("%d\n", (a >> 30));


 printf("%d\n", (b >> 32));
 printf("%d\n", (b >> 31));
 printf("%d\n", (b >> 30));

 

 printf("%d\n", (c >> 1));

 return 0;
}

출력화면

-214783648

1

2

-214783648

-1

-2

0

 

여기서 a>>32 b>>32 c>>1 왜 다르냐?

0이 맞는거냐? 오버플로우된 -214783648이 맞는거냐