• 各类型的sizeof()值


    参考一:

    sizeof (char unsinged char   singed char ) =1     字符类型规定为1

    sizeof ()

    [signed] int                    2     16bit

    unsinged int                    2

    [signed]short [int]             2

    unsigned short [int]            2

    [singed] long [int]             4     32bit

    unsigned long [int]             4

    float                           4     

    double                          8    64bit

    long double                     16   128bit

    sizeof(数组) = 数组长度

    sizeof(指针) = 2

    sizeof(结构体struct) = 所有结构字节数总和

    sizeof(联合体union) = 最大成员字节数

    参考二:

    数据类型 说明 字节数 取值范围
    bool 布尔型 1 true,false
    char 字符型 1 -128~127
    unsigned char 无符号字符型 1 0~255
    short 短整型 2 -32768~32767
    unsigned short 无符号短整型 2 0~65535
    int 整型 4 -2147483648~2147483647
    unsigned 无符号整型 4 0~4294967295
    long 长整型 4 -2147483648~2147483647
    unsigned long 无符号长整型 4 0~4294967295
    float 单精度型 4 -3.4×10-38~3.4×10-38
    double 双精度型 8 -1.7×10-308~1.7×10-308
    long double 长双精度型 8 -1.7×10-308~1.7×10-308
  • 相关阅读:
    字符串和编码
    Python基础
    输入和输出
    Python代码运行助手
    使用文本编辑器
    第一个Python程序
    pycharm中创建并设置docker解释器
    docker 在windows上的使用
    Python time datetime模块
    Linux安装字体文件
  • 原文地址:https://www.cnblogs.com/snailrun/p/2644865.html
Copyright © 2020-2023  润新知