Make Unreal REAL.
article thumbnail

 

if 조건문 안에서도 해당 블록에서 사용할 수 있는 지역 변수를 선언할 수 있다.

 

<cpp />
#include <iostream> using namespace std; void main() { if (bool b = true) cout << boolalpha << b; }

 

출력

<cpp />
true

'C++ > 기타' 카테고리의 다른 글

정수 표기법(Literal)  (0) 2023.04.19
동적 할당 시 0으로 초기화  (1) 2023.03.20
콤마(,) 연산자  (0) 2023.03.20
람다 식에서 [this] 캡처  (0) 2023.03.15
클래스 전방 선언(Forward declaration)  (0) 2023.03.07
profile

Make Unreal REAL.

@diesuki4

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

검색 태그