bool literal
From cppreference.com
Syntax
true | (1) | ||||||||
false | (2) | ||||||||
Explanation
- boolean
true
(value of 1) - boolean
false
(value of 0)
Example
Run this code
std::cout << std::boolalpha << true << '\n' << false << '\n' << std::noboolalpha << true << '\n' << false << '\n';
Output:
true false 1 0