我尝试执行以下程序:
#include <stdio.h>
int main() {
signed char a = -5;
unsigned char b = -5;
int c = -5;
unsigned int d = -5;
if (a == b)
printf("\r\n char is SAME!!!");
else
printf("\r\n char is DIFF!!!");
if (c == d)
printf("\r\n int is SAME!!!");
else
printf("\r\n int is DIFF!!!");
return 0;
}
对于此程序,我得到了输出:
字符是DIFF !!!诠释是相同的!
为什么我们为两者获得不同的输出?
输出应该如下吗?
字符是相同的!诠释是相同的!
一个键盘连接。