从我从得到的回答这个问题,看来C ++继承了这一要求,对于转换short成int从C五月我执行算术运算时,挑选你的大脑,以为什么这是用C首先介绍?为什么不做这些操作short呢? 例如(摘自dyp在评论中的建议): short s = 1, t = 2 ; auto x = s + t ; x将具有int类型。
我尝试执行以下程序: #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 …