What does cout<<(0==0) print out?

[复制链接]
查看11 | 回复5 | 2012-7-8 18:27:19 | 显示全部楼层 |阅读模式
It will print out "1" as "0==0" gives out "true" in C++ and it will be cast to integer, which is 1 in this case, before it is printed out....
回复

使用道具 举报

千问 | 2012-7-8 18:27:19 | 显示全部楼层
0==0的bool值为真(true),那么应该是1,所以输出1~...
回复

使用道具 举报

千问 | 2012-7-8 18:27:19 | 显示全部楼层
1,0==0在计算机看来结果是1...
回复

使用道具 举报

千问 | 2012-7-8 18:27:19 | 显示全部楼层
true...
回复

使用道具 举报

千问 | 2012-7-8 18:27:19 | 显示全部楼层
1...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行