C++ 자료형 (Data Type)

2021. 3. 9. 19:35·SW개발/C++
반응형

자료형 (Data Type)

<limits> 라이브러리

  • 자료형의 최대, 최소 확인

    std::cout << std::numeric_limits<short>::max() << '\n';
    std::cout << std::numeric_limits<short>::min() << '\n';
    std::cout << std::numeric_limits<short>::lowest() << '\n';
  • min, lowest 차이

    • min : the smallest finite number that is > 0 representable in the type
      • 즉 표현할 수 있는 정밀도의 단위이다.
    • lowest : the smallest finite number that is representable
      • 흔히 말하는 최솟값이다.

고정 너비 정수(Fixed-width Integer)

  • C++11

  • <cstdint> 라이브러리(<iostream>에 포함)

  • fast type(std::int_fast#_t)

    • 최소 #비트의 너비로 가장 빠른 타입을 제공한다.
  • least type(std::int_least#_t)

    • 최소 #비트의 너비로 가장 작은 타입을 제공한다.
  • 지양할 것

    • std::int8_t

      • char로 처리되기 때문에 출력 시 ASCII로 변환되어 나온다.
반응형
저작자표시 (새창열림)

'SW개발 > C++' 카테고리의 다른 글

C++ Boolean  (0) 2021.03.09
C++ 소수점 (Decimal Point)  (0) 2021.03.09
따라하며 배우는 C++ 2장  (0) 2021.03.09
C++ 전처리기 (Preprocessor)  (0) 2021.03.09
C++ Namespace  (0) 2021.03.09
'SW개발/C++' 카테고리의 다른 글
  • C++ Boolean
  • C++ 소수점 (Decimal Point)
  • 따라하며 배우는 C++ 2장
  • C++ 전처리기 (Preprocessor)
Caniro
Caniro
  • Caniro
    Minimalism
    Caniro
  • 전체
    오늘
    어제
    • 전체보기 (319)
      • SW개발 (268)
        • Java Spring (6)
        • C++ (186)
        • Python (21)
        • Linux (16)
        • 알고리즘 (13)
        • Git (4)
        • Embedded (1)
        • Raspberrypi (9)
        • React (3)
        • Web (2)
        • Windows Device Driver (6)
      • IT(개발아님) (46)
        • Windows (26)
        • MacOS (7)
        • Utility (11)
      • 챗봇 짬통 (0)
      • 일상 (2)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    맥북 카카오톡 알림 안뜸
    EXCLUDE
    알림
    unix
    윈도우
    vscode
    시스템 복구
    SFC
    그림판
    KakaoTalk
    백기선
    스프링
    windows
    MacOS
    logi options
    Workspace
    스프링 프레임워크 핵심 기술
    citrix workspace
    Solaris 10
    mspaint
    윈도우 명령어
    SunOS 5.1
    spring
    dism
    Windows 11
    로지텍 마우스 제스처
    java
    제외
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
Caniro
C++ 자료형 (Data Type)
상단으로

티스토리툴바