Closed fuhsnn closed 9 months ago
#include <stdio.h> int main(void) { signed char c = 1; printf("%d\n",(int)(signed char)(c << 7)); // expect -128, got 128 printf("%d\n",sizeof(c << 7)); // expect 4, got 1 short s = 1; printf("%d\n",(int)(short)(s << 15)); // expect -32768, got 32768 printf("%d\n",sizeof(s << 15)); // expect 4, got 2 }