About 53 results
Open links in new tab
  1. What's the difference between "bool" and "bool?"?

    Oct 5, 2016 · bool is a value type, this means that it cannot be null, so the Nullable type basically allows you to wrap value types, and being able to assign null to them. bool? can contain three different …

  2. What is the difference between BOOL and bool? - Stack Overflow

    Dec 14, 2019 · The values for a bool are true and false, whereas for BOOL you can use any int value, though TRUE and FALSE macros are defined in the windef.h header. This means that the sizeof …

  3. Difference between _Bool and bool types in C? - Stack Overflow

    Jan 4, 2012 · These data types were added in C99. Since bool wasn't reserved prior to C99, they use the _Bool keyword (which was reserved). bool is an alias for _Bool if you include stdbool.h. Basically, …

  4. Do the &= and |= operators for bool short-circuit? - Stack Overflow

    Apr 16, 2014 · bool allTrue = true; allTrue = allTrue && check_foo(); allTrue = allTrue && check_bar(); check_bar() will not be evaluated if check_foo() returned false. This is called short-circuiting or short …

  5. boolean - What is bool in C++? - Stack Overflow

    Bool is a well-defined primitive integral type, just like int, char, etc. It also has mathematical conversions to other integral types, which can sometimes be confusing for people, but I don't think that is the …

  6. Operator |= for a boolean in C++ - Stack Overflow

    bool result = false; for(int i = 0; i<n; i++){ result |= TryAndDoSomething(i); } I supposed that this |= was a shortcut for the OR operator, and that result would equal true in the end if at least one of these calls …

  7. What is the difference between bool and Boolean types in C#

    Sep 25, 2008 · 2 bool is a primitive type, meaning that the value (true/false in this case) is stored directly in the variable. Boolean is an object. A variable of type Boolean stores a reference to a Boolean …

  8. Why are C booleans called _Bool? - Stack Overflow

    Dec 14, 2017 · It contains the macro bool, which expands to _Bool. And also the macros false and true that expand to 0 and 1. Though note that booleans are not fully integrated in the C language, as they …

  9. coding style - Using if (!bool) vs if (bool == false) in C# - Stack ...

    Sep 23, 2011 · This is the preferred version, as since you already have a bool variable that contains a true or false, there is no reason to do an additional evaluation in the if statement.

  10. In c, in bool, true == 1 and false == 0? - Stack Overflow

    Oct 12, 2016 · And that is why IMO the bool is of use only for setting a value, not testing. For testing, it's inherent in the C langauge without any formal definition. I'll go further: the bool type is completely …