Ok, so I\'ve read about this a number of times, but I\'m yet to hear a clear, easy to understand (and memorable) way to learn the difference between:
if (x |
Without delving into the details in any way, shape, or form, here's a real layman's version.
Think of "|" as a straight "or" in english; think of "||" as "or else" in english.
Similarly think of "&" as "and" in english; think of "&&" as "and also" in english.
If you read an expression to yourself using these terms, they often make a lot more sense.