MARK
对于下面的程序
int b = 1, c = 4;
bool a = !b||c>3;
因为优先级顺序从高到低为!, >, ||
,所以上述程序a
的值为true
,相当于:
int b = 1, c = 4;
bool a = (!b) || (c>3);
MARK
对于下面的程序
int b = 1, c = 4;
bool a = !b||c>3;
因为优先级顺序从高到低为!, >, ||
,所以上述程序a
的值为true
,相当于:
int b = 1, c = 4;
bool a = (!b) || (c>3);