if(condition1 and condition2){
//body
}
If condition1 turns out to be false, will c++ compiler check for condition2 or will it directly return false?
if(condition1 and condition2){
//body
}
If condition1 turns out to be false, will c++ compiler check for condition2 or will it directly return false?
What you described is called short-circuit evaluation and C++ does use it: if condition1
is false, condition2
will not be checked.