Can anyone explain how the bool
data type works? Please include a sample program (just a simple one) and the explanation on how it works. Thanks!
bool is an 8-bit integral data type that allows only bit 0 to be read. Thus, they can be assigned any value, but when read they will be either 1 or 0.
Last edited on
A bool datatype can accept 2 values (as far as I know), true and false.
You declare and initialize one like this:
bool var=true; //var=1
or
bool var=false; //var=0
Thanks! I understand it now...