Why '&&' and not '&'?

前端 未结 16 1517
别跟我提以往
别跟我提以往 2020-11-27 12:11

Why is && preferable to & and || preferable to |?

I asked someone who\'s been programming for years a

16条回答
  •  失恋的感觉
    2020-11-27 13:04

    C# Operators should explain why:

    Essentially having two &'s or |'s means that it is a conditional rather than a logical, so you can tell the difference between the two.

    & Operator has an example of using one &.

提交回复
热议问题