3 Answers
New Answer... As a matter of fact, yes. bool test = true; std::cout << std::boolalpha << test; // outputs true
In C++, 1 (or any other value other than 0 casted to bool) is true, and 0 is false. if (1) and if (true) is the same thing. tl;dr - C++ will display boolean values as 1 or 0.
@hatsey how we can get normal true or false. can we yes we can use these as well but is there a way to do so.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message