cppforever.com

bool

C++ defines a dedicated boolean type named bool, representing logical truth values:

Example:

bool isReady = true;

C inherits this (C99 and newer), but in classic C, booleans were represented using integers.

Disadvantages

The data type bool allocates 8 bits of memory, but only one bit is needed, which is wasteful.

Alternatives

Bit fields