Hallo.
Would someone be able to tell me the difference between these two pieces of code?
if(a==b || a==c)
//whatever
if(a==b | a==c)
//whatever
I seem to think that the second example will only test the second argument (a==c) if the first (a==b) proves false.
Is this correct?
I can't remember where I came across this, but it would be immensely useful if true.
Cheers,
Douglas JL
A salesman is a machine for turning coke into obnoxious arrogance.
Common sense is what tells you the world is flat.
Would someone be able to tell me the difference between these two pieces of code?
if(a==b || a==c)
//whatever
if(a==b | a==c)
//whatever
I seem to think that the second example will only test the second argument (a==c) if the first (a==b) proves false.
Is this correct?
I can't remember where I came across this, but it would be immensely useful if true.
Cheers,
Douglas JL
A salesman is a machine for turning coke into obnoxious arrogance.
Common sense is what tells you the world is flat.