Skip to content

数据类型

cpp
    // 整型,一般为4字节
    int value;
    signed int value;
    signed value;
    
    // 短整型,一般为2字节
    signed short int value;
    signed short value;
    short value;
    short int value;
    
    // 长整型,一般为4字节
    signed long int value;
    signed long value;
    long int value;
    long value;
    
    // 超长整型,一般不低于长整型
    signed long long int value;
    signed long long value;
    long long int value;
    long long value;
    
    // 添加unsigned,使值>=0
    unsigned int value;
    unsigned short value;
    unsigned long value;
    unsigned long long value;
    
    // 浮点型
    float value;
    
    // 双精度浮点型
    double value;
    
    // 长双精度浮点型
    long double value;
    
    // 单个字符
    char value;
    unsigned char value;
    signed char value;
    
    // 单个utf - 8字符
    char8_t value;

    // 单个utf - 16字符
    char16_t value;

    // 单个utf - 32字符
    char32_t value;
    
    // 单个宽字符
    wchar_t value;
    
    // 布尔类型
    bool value;