Why does printing a character variable with %d give a negative value in c?

前端 未结 0 1398
北恋
北恋 2020-11-28 18:11

I tried the following piece of code, expecting the output to be positive 64:

char val = 0x80; 
printf("%d",val>>1);

My unders

相关标签:
回答
  • 消灭零回复
提交回复
热议问题