ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [C++] 자료형
    c++ 2024. 2. 11. 22:22

     

      자료형 크기 범위 
    논리형 bool 1 byte (8 bit) 0 ~ 1
    문자형 (signed) char 1 byte (8 bit) -128 ~ 127
    unsigned char 0 ~ 255
    정수형 (signed) short (int) 2 byte (16 bit) -32,768 ~ 32,767
    unsigned short (int) 0 ~ 65,535
    (signed) int 4 byte (32 bit) -2,147,483,648 ~ 2,147,483,647
    unsigned int 0 ~ 4,294,967,295
    (signed) long (int) 4 byte (32 bit) -2,147,483,648 ~ 2,147,483,647
    unsigned long (int) 0 ~ 4,294,967,295
    (signed) long long (int) 8 byte (64 bit) -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807
    unsigned long long (int) 0 ~ 18,446,744,073,709,551,615
    실수형 float 4 byte (32 bit) 3.4E+/-38(7개의 자릿수)
    double 8 byte (64 bit) 1.7E+/-308(15개의 자릿수)
    long double 8 byte (64 bit) double과 동일

     

    출처 / https://learn.microsoft.com/ko-kr/cpp/cpp/data-type-ranges?view=msvc-170

    'c++' 카테고리의 다른 글

    [C++] 동적할당에 대해 알아보자  (0) 2024.02.20

    댓글

Designed by Tistory.