what does bool means? is it a kind of variable declaration?
what does bool means? is it a kind of variable declaration?
A bool is a type, just like int, char and double. It holds boolean values. There are only two possible boolean values: true or false. So every bool variable holds either true or false.
They are used a lot in programming because many situations rely on some state or expression being true or false (like the controls of if statements or loops).
More than a data type, Boolean logic is one of the backbones of computer science. Computers at their very core work with Boolean logic. True and False, On and Off, 1s and 0s... This and that, this or that, this not that.
You should do a search on Google about "Boolean Logic" or "George Boole". It's one of the fundamentals of Computer Science and understanding it will greatly help you advance as a programmer.
Sent from my iPadŽ