Variable size of bool : bool « Data Types « C++ Tutorial






#include <iostream>
  
int main()
{
   using std::cout;
  
   cout << "The size of a bool is:"      << sizeof(bool)   << " bytes.\n";
  
   return 0;
}
The size of a bool is:1 bytes.








2.6.bool
2.6.1.bool values
2.6.2.A bool value can control the if statement
2.6.3.Outcome of a relational operator is a true/false value
2.6.4.Variable size of bool
2.6.5.The || Operator
2.6.6.The !(Exclamation mark) Operator
2.6.7.The && Operator (amplifier)
2.6.8.Output boolean variable as boolean literal or number
2.6.9.Use bool value to control a while loop
2.6.10.Logical operators.