char a = 100; char b = 150; unsigned char c ; c =(a < b)?a:b; 请问c的值为

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 04:54:41
chara=100;charb=150;unsignedcharc;c=(achara=100;charb=150;unsignedcharc;c=(achara=100;charb=150;unsi

char a = 100; char b = 150; unsigned char c ; c =(a < b)?a:b; 请问c的值为
char a = 100; char b = 150; unsigned char c ; c =(a < b)?a:b; 请问c的值为

char a = 100; char b = 150; unsigned char c ; c =(a < b)?a:b; 请问c的值为
因为char是有符号的,而b已经超出char的上限127,所以b在比较时被当作是-106.
所以,a是大于b的,最后一条的(a