In C language, when we want to express true or false, we always define a non-bool type to use.
In C++, the basic types of Boolean bool are added, which are true or false, or non-zero values are true and 0 is false. In C++, although Boolean types only represent true and false, it seems that one bit can be used to store variables of Boolean types. In fact, Boolean types occupy one byte in C++.
Related information:
In C language, it is generally believed that 0 is false and non-0 is true. This is because there was no bool type in c90 before c99. However, c99 introduced the _Bool type (_Bool is a type, but in the newly added header file stdBool.h, it was rewritten as bool with macros to ensure the compatibility of C/C++). Up to now, the standard adopted by most C language books is c90 standard, so we seldom use bool type.
The return result of logical expressions in C language, such as the return result of a==b, has only two possibilities: 0 and 1, but their size is indeed 4, that is, shaping is used to represent truth and falsehood.