Just a tiny but hopefully

As it stands, both logical && and bitwise & will produce the same result.
If i++ were tested for equality with an int other than 0
it would bring the second concept in the explanation into play.
Moderator: admin
In this particular case, yes.Daniel Clinton wrote:Hi Paul,
Just a tiny but hopefullyuseful thought I had about the question.
As it stands, both logical && and bitwise & will produce the same result.
Not sure what you mean. Can you write it in code so that it is clear what you mean?If i++ were tested for equality with an int other than 0
it would bring the second concept in the explanation into play.
Code: Select all
int i = 0;
int j = 1;
if ((i++ == 1) & (j++ == 2)) {
i = 12;
}
Users browsing this forum: No registered users and 3 guests