bool (Boolean)
The boolean type
what is a boolean? A boolean is a data type that stores 1 bit values.
how do we use booleans?
The method of declaring a boolean variable is:
bool name;
where "bool" refers to the boolean type.
bools can store a 1 bit value, 0 or 1, which are known as false or true.
Example:
bool variable = true;
Last updated
Was this helpful?