i want to understand that what is bolean data type in c++. I tried to my best but i can not understand boolean data type plz help me
The built-in Boolean data type in C++,
bool, is quite simple: it is a data type which can hold one of two values,
false. It can be used to hold a truth value for comparisons:
bool overflow = false;
// ... do some things
overflow = (foo > bar);
// ... do some more things
In this case, it is used becausse there are actions both before and after the place where the value is checked, so it cannot be in just the conditional of the
It is most often used as the return value for a function that returns a true or false result based on some test.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.