본문 바로가기

Programming/C&C++&C#

modern C++ 11/14 iteral & type, auto & decltype

728x90
반응형
#include <iostream>

using namespace std;

int main (void)
{
    // literal & type
    int n1 = 0b1001;         // 2진수로 표시
    int n2 = 010;            // 8진수
    int n3 = 10 ;            // 10진수
    int n4 = 0x10;            // 16진수


    int number = 1'001'000;        // 컴파일에서 '문자가 무시된다. 단위 셀때 편함.

    long long n3;            // 64bit 정수 변수

    // auto / decltype
    double x[3] = {0, 1, 2};    //
    auto n4 = x[0];            // 우변의 수식으로 좌변 타입이 결정됨

    decltype(n1) d2;        // int d2와 같음

}
반응형

'Programming > C&C++&C#' 카테고리의 다른 글

modern C++ using 사용법  (0) 2019.12.15
modern C++ static_assert  (0) 2019.12.15
modern C++  (0) 2019.12.15
[C언어]매크로 (Mecro) 사용  (0) 2019.03.10
[C언어]scanf 사용시 버퍼 비우기  (0) 2019.03.10