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

    Oct 5, 2016 · Since bool is a value type (just as int, long, double, DateTime and some other types), it will always be initialized to a default value (false in the case of a bool, 0 in the case of an int).

  2. 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, …

  3. Using Boolean values in C - Stack Overflow

    bool and _Bool, and true and false are language keywords for boolean types. bool / _Bool is a type that can hold either the value true or false. Logical operators !, ||, and && can be used.

  4. 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 …

  5. 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 …

  6. c# - Convert nullable bool? to bool - Stack Overflow

    May 20, 2011 · How do you convert a nullable bool? to bool in C#? I have tried x.Value or x.HasValue ...

  7. 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 …

  8. boolean - Why is bool 8 bits long in C++? - Stack Overflow

    Aug 14, 2025 · In C++, why is the bool type 8 bits long (on my system)? Only one bit is enough to hold the Boolean value. I used to believe it was for performance reasons, but then on a 32 bits or 64 bits …

  9. c++ - How to read a bool using std::cin - Stack Overflow

    bool a; cin >> a; I understand that if I give 0 or 1, my data a will be either true or false. But what happens if I give another integer or even a string ? I was working on the following code :

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

    Apr 16, 2014 · From C++11 5.17 Assignment and compound assignment operators: The behavior of an expression of the form E1 op = E2 is equivalent to E1 = E1 op E2 except that E1 is evaluated only …