首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

if语句都出错了!大家来看看!该如何处理

2012-02-10 
if语句都出错了!大家来看看!#includestdio.h#includeiostream.hmain(){charc0x00c&0x040x00?cout

if语句都出错了!大家来看看!
#include   <stdio.h>
#include   <iostream.h>

main()
{
        char   c   =   0x00;

        c   &   0x04   ==   0x00   ?   cout   < <   "0 "   :   cout   < <   "1 ";
}

结果:输出1

程序很简单,0x00&0x04应该为0啊,为什么是非0?

[解决办法]
是不是char型的不能直接==阿?

热点排行