我对IF声明有一个基本的疑问.假设我想将字符串SUN与字符数组(大小为3)匹配.
if(arr[0]!='S' || arr[1]!='U' || arr[2]!='N') cout << "no"; else cout<< "yes";
是否在If语句中检查了所有条件,还是在第一次不匹配时返回true?
如果检查了所有条件,检查顺序是从右到左?
c++ if-statement operators logical-operators
c++ ×1
if-statement ×1
logical-operators ×1
operators ×1