불 리터럴
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
|