⚠️ 문제상황
C++에서는 bool 값이true
false
로 바로 출력이 안됨
bool x = true;
bool y = false;
std::cout << x << y;
🖥️ 출력
1
0
📖 해결방법
출력전에 std::boolalpha를 적어주면true
false
로 출력된다.
std::cout << boolalpha << x << boolalpha << y;
🖥️ 출력
true
false
출처
'C++에서 true false 출력', https://gdlovehush.tistory.com/231, (2020. 7. 17.)