小编REK*_*AUS的帖子

为什么在这种情况下类型 bool 的输出等于 0?

#include <iostream>
#include <cmath>
using namespace std;

int
main ()
{
  cout << ('x' > 0xFF) || (3 * 5 < 35) && (53 > 5 * 3);
  cout << ('x' > 0xFF);
  cout << (3 * 5 < 35) && (53 > 5 * 3);
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

我得到 001 即使据我所知它应该是 101 。

c++ boolean

4
推荐指数
1
解决办法
64
查看次数

标签 统计

boolean ×1

c++ ×1