常数默认是带符号数
如果无符号数与带符号数混合使用,则带符号数默认转换成无符号数,举个例子:
#include <stdio.h>
int main()
{
unsigned i;
int cnt = 3, n = 1;
for(i=cnt-2; i>=0; i--)
printf("%d
", n++);
// 如果无符号数与带符号数混合使用,则带符号数默认转换成无符号数
// i是无符号数,所以i始终大于零,程序陷入死循环
return 0;
}