if (2 & 2 > 1)
{
// something wrong?
cout <<"I don't think this line could display..." <<endl ; // 1)
}
//if
观察上述代码, 问: 语句 1) 能被执行么?
答案是: 不能执行. 
                       2 & 2 > 1        红色部分先判断, 因为 > 优先级高于 & .
  
if ((2 & 2) > 1) // (2 & 2)括号不能少
{
// something wrong?
cout <<"I don't think this line could display..." <<endl ; // 1)
}//if

相关文章:

  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
猜你喜欢
  • 2021-08-20
  • 2022-01-24
  • 2022-01-13
  • 2021-09-09
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案