Re: &= for bools?
- From: Pavel Minaev <int19h@xxxxxxxxx>
- Date: Fri, 6 Mar 2009 13:49:57 -0800 (PST)
On Mar 6, 1:40 pm, andy.johnst...@xxxxxxxxxxxxxxxxxx wrote:
"The & operator performs a bitwise logical AND operation on integral
operands and logical AND on bool operands."
Ah, I missed that, thanks. Does this beg the question "Why is the &&
operator needed then?" ?
&& is a logical operator, and & is the bitwise operator. The
expression on each side of && MUST evaluate to a boolean. & can be
used with other number types.
Please read the thread to which you're responding before doing that.
As noted by Geoffrey, in C# what you say is wrong - operators & and |
are Boolean and not bitwise when applied to bool operands (and yes,
they can be used with bool).
.
- Follow-Ups:
- Re: &= for bools?
- From: andy . johnstone
- Re: &= for bools?
- References:
- &= for bools?
- From: proxyuser
- Re: &= for bools?
- From: z . sessions
- Re: &= for bools?
- From: Geoffrey Summerhayes
- Re: &= for bools?
- From: proxyuser
- Re: &= for bools?
- From: andy . johnstone
- &= for bools?
- Prev by Date: Re: RichTextBox & Embedding Objects in it
- Next by Date: Re: &= for bools?
- Previous by thread: Re: &= for bools?
- Next by thread: Re: &= for bools?
- Index(es):
Relevant Pages
|