I have seen this syntax in a program but I am not sure what happens at the return part. What does the ||(or) mean? Does this mean that the method returns true when at least one of a and b is true and returns false when both of them are false?
bool A::truthValue() {
bool a = true;
bool b = true;
if(........)
a= false;
if(........)
b=false
return (a || b);
}
It will return true if either b or a is true. This means that the result is (see table):
Actually in your specific case, false will be returned only if both
ifstatements become true.EDIT So – your suggestion is correct.