疑难错误之结果类型转换

Posted tibetanmastiff

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了疑难错误之结果类型转换相关的知识,希望对你有一定的参考价值。

    unsigned int nslot = 1;

    printf("%d\n", 0 < nslot -2);

  以上输出结果是多少呢?

        在linux上编译之后,输出结果为1.  原因是nslot为unsgined int, 2 为常数,输出结果类型也为unsgined int。

以上是关于疑难错误之结果类型转换的主要内容,如果未能解决你的问题,请参考以下文章