`false` — C++ Keyword
`false` — C++ Keyword
The false keyword in C++: the Boolean literal for the false value.
`false` — C++ Keyword
The false keyword in C++: the Boolean literal for the false value.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
falseThe Boolean literal representing the value 0 (logically false). Has type bool.
bool b = false;
#include <print>
int main() {
bool done = false;
std::println("{}", done); // false
std::println("{}", static_cast<int>(false)); // 0
while (!done) {
std::println("working...");
done = true; // exits after one iteration
}
// Comparison
std::println("{}", (1 == 2)); // false
std::println("{}", (0 == false)); // true (0 converts to false)
}
false converts to 0 in arithmetic contexts.nullptr converts to false; any non-null pointer converts to true.falseint main() {
// Pick one facility from this reference page.
// Write the smallest program that exercises its main precondition,
// complexity rule, or lifetime constraint before scaling up.
return 0;
}