Will wrapping a boolean in parentheses within a conditional change the value of the bool? To my knowledge (Bool_two) is the same as &Bool_two. Please correct me if I'm wrong.
For example:
Bool_one = true;
Bool_two = true;
X = 0;
if(Bool_one && !(Bool_two))
X++;
I'm seeing the above scenario evaluate and increment X, even though I believe it should be evaluating the conditional as False and therefore not incrementing.
Bool_one = true;
Bool_two = true;
X = 0;
if(Bool_one && !Bool_two)
X++;
Are these two examples equivalent in terms of their evaluations?
Aucun commentaire:
Enregistrer un commentaire