불 리터럴
cppreference.com
문법
true
|
(1) | ||||||||
false
|
(2) | ||||||||
설명
불 리터럴은 키워드 true와 false이다. 이들은 불 유형 prvalues이다.
Notes
See Integral conversions for implicit conversions from bool to other types and boolean conversions for the implicit conversions from other types to bool.
예시
코드 실행
#include <iostream>
int main()
{
std::cout << std::boolalpha
<< true << '\n'
<< false << '\n'
<< std::noboolalpha
<< true << '\n'
<< false << '\n';
}
Output:
true
false
1
0
See also
C documentation for Predefined Boolean constants
|