About 212,000 results
Open links in new tab
  1. Is there any difference between && and & with bool (s)?

    Jul 5, 2011 · Is a bitwise and of bools portable? c++; bitwise-operators; boolean; logical-operators; language-lawyer ...

  2. boolean - When should you use bools in C++? - Software …

    Depending on your compiler, there might be optimizations that it can perform on code that uses Bools to store mapped true/false values. Whereas, there might not be optimizations it can …

  3. Using bitwise operators for Booleans in C++ - Stack Overflow

    Aug 24, 2008 · Patrick made good points, and I'm not going to repeat them. However might I suggest reducing 'if' statements to readable english wherever possible by using well-named …

  4. c++ - How is a bool represented in memory? - Stack Overflow

    Oct 14, 2013 · The standard doesn't mandate anything for the binary representation of bools; it just says that, when converting to other integral types, a true bool will become 1 and a false …

  5. boolean - C++ code, bools, and loops - Stack Overflow

    Jun 18, 2014 · Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Try Teams for free Explore Teams

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

    Aug 4, 2013 · Bools can be references, just like anything else. It seems maybe you're confused about the difference between a pointer and a reference there. As for the second code snippet, …

  7. c# - What's the difference between "bool" and "bool ... - Stack …

    Oct 5, 2016 · The ? symbol after a type is only a shortcut to the Nullable type, bool? is equivalent to Nullable<bool>.. bool is a value type, this means that it cannot be null, so the Nullable type …

  8. How to create a byte out of 8 bool values (and vice versa)?

    Dec 11, 2011 · Suppose we have 8 bools b[0] to b[7] whose least significant bits are named a-h respectively that we want to pack into a single byte. Treating those 8 consecutive bool s as …

  9. Why use flags+bitmasks rather than a series of booleans?

    Sep 11, 2009 · It uses considerably less memory. Putting all 4 of your example values in a bitmask would use half a byte. Using an array of bools, most likely would use a few bytes for …

  10. .net - Is a bool read/write atomic in C# - Stack Overflow

    Sep 12, 2008 · bool accesses are indeed atomic, but that isn't the whole story. You don't have to worry about reading a value that is 'incompletely written' - it isn't clear what that could possibly …