what is "bool"?

I haven't found anything in any of the books I've read, and I cant seem to find anything with google that gives a clear explanation of what it is, so what is bool? and how can I use it? A description of what it is and some examples of how to use it and stuff would be great, thanks in advance for any help.
"Bool" is short for "Boolean": http://en.wikipedia.org/wiki/Boolean_datatype
I haven't found anything in any of the books I've read

Then you're reading the wrong books. bool should always be mentioned in the first or second chapter when variables and data types are introduced.
A bool can only have two values, true or false.
Last edited on
strongdrink's comment ^.
If you typed in bool on google, the first result would be what Computergeek01 linked to. Learn to use Google, for it is a nice resource when you quickly need to look up something.
strongdrink hit the nail but since you're looking for an example ...

bool is a type just like int or char so you wud declare a variable of type bool.

1
2
3
bool x;
x = true; //or
x = false;


use can also use 1s and 0s, 1 for true, 0 for false.

practical uses? testing functions

write a function filled with code testing some calculation or whatnot then returning true if it passes or false if it doesnt.
Can I add something? I think boolean logic was invented by George Boole and hence the name credited to his honor ? :P
Thanks for all the help, I suppose having access to this nice forum has been making me lazy, normally I would just google something and eventually find what I was looking for, no matter what I was searching for, but I havnt been thinking to clearly lately, to much insomnia, and mix that with ADD and then throw in a ton of preCalc homework, and youve got yourself a very tired person who now has an even harder time focusing on stuff and has a somewhat fried brain from doing complicated math while very tired... anyways, again thanks all for the help :)
Topic archived. No new replies allowed.