A datatype in C++ (and no doubt, other languages too) for boolean (see George Bool) variables (i.e., values that are either true or false). The beauty of bool is that it ditches the old C practice of using a whole int variable to hold either a 0 or a 1, which is a huge waste of bits. Well, not really that huge, but I guess it's the principle of the thing.

I've found that most compilers' bools are implemented as chars, so no matter what there's wasted bits. When I code in C, I use chars for Booleans too, not ints.

Objective C's bool type is kinda weird, in that it's all caps (BOOL), and for the constants, instead of true/false, it's YES/NO.

Log in or register to write something here or to contact authors.