Make Unreal REAL.
article thumbnail
Published 2023. 4. 19. 20:11
정수 표기법(Literal) C++/기타

 

진법 표기를 위한 0x, 0b 등의 접두사(Prefix)가 있고, 자료형을 나타내기 위한 f, ull 등의 접미사(Suffix)가 있다.

 

<cpp />
#include <iostream> using namespace std; void main() { int binary = 0b1010; int octal = 012; int decimal = 10; int hexadecimal = 0xA; cout << binary << endl; cout << octal << endl; cout << decimal << endl; cout << hexadecimal << endl; }

 

출력

<cpp />
10 10 10 10

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

if 조건문에서 지역 변수 선언  (0) 2023.05.06
동적 할당 시 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

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

검색 태그