bool b = 0;
int a = 2;
cout << b || a; // 0
bool b = 0;
int a = 2;
cout << (b || a); // 1
过去多啦不再A梦2017-06-24 09:45:01
<< has priority 5, which is higher than ||’s priority 12.
1 () [] . ->
2 ! ~ -(负号) ++ -- &(取变量地址)* (type)(强制类型) sizeof
3 * / %
4 + -
5 >> <<
6 > >= < <=
7 == !=
8 &
9 ^
10 |
11 &&
12 ||
13 ?:
14 = += -= *= /= %= |= ^= &= >>= <<=
15 ,