Re: &= for bools?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Mar 6, 5:49 pm, Pavel Minaev <int...@xxxxxxxxx> wrote:
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).

So your glass is half empty, and mine is half full? If you're only
dealing with one bit (which is what a bool represents), it's a bitwise
AND.
.



Relevant Pages

  • Re: How do I write directly to a memory address?
    ... // we do have a bool type on this compiler, ... If you don't want to just do builtin bitwise v1 & v2, ... and 0 if the operand has any-one-bits. ... It's easier to eschew such identifiers and safely avoid any problem. ...
    (comp.lang.ada)
  • Re: Exposing bool to non-MS, non-C++ callers
    ... arguments to bool and return a bool result (or so claims the on-line ... So I'm fine using char data types in my public structures and ... I just have to be careful to avoid the bitwise logical ... char boolOne; ...
    (microsoft.public.dotnet.languages.vc)
  • Re: A way to bitwise AND two ints
    ... >> to bitwise AND two int's together and get a bool. ... >> How do I get the proper response from: ... you want positive ints to count as true. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: &= for bools?
    ... dealing with one bit (which is what a bool represents), it's a bitwise ... fact does not even consider bool an integral type (it can't be ... When the operands ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Boolean data type?
    ... What type is commonly used in C for playing around with boolean ... It might even make sense to store a boolean value in each bit ... (but you'll have to write your own bitwise masking and shifting code ... Assuming C99's _Bool is not available, ...
    (comp.lang.c)