zoukankan      html  css  js  c++  java
  • iOS 数据类型

    OC:基本数据类型

    字数450 阅读881 评论2 喜欢5
    基本类型

    类型限定修饰词

    除了上图中基本类型之外,还有一些类型限定修饰词

    • short短型,修饰int、double;
    • long长型,修饰int、double;
    • signed有符号型,修饰int、char;
    • unsigned 无符号型,修饰int、char;

    1.这些限定词经常用来限定int型,在限定int类型时int可以省略;
    2.short和long会改变int型的长度,在不同编译器长度不相同,但是一般short长度不大于int,int长度不大于long;
    3.signed和unsigned不会改变类型长度,仅表示最高位是否为符号位,其中unsigned表示大于等于0的正数;

    取值范围

    为了以后开发中能够方便查找,并正确的使用数据类型,下面是部分数据类型的取值范围:

    • int:-2147483648~2147483647
    • unsigned int:0~4294967295
    • short:-32768~32767
    • unsigned short:0~65535
    • long: -2147483648~2147483647
    • unsigned long:0~4294967295

    存储空间

    下面列出的是常用数据类型占用的存储空间

    数据类型16位编译器32位编译器64位编译器
    char 1byte 1byte 1byte
    int 2byte 4byte 4byte
    float 4byte 4byte 4byte
    double 8byte 8byte 8byte
    short int 2byte 2byte 2byte
    unsigned int 2byte 4byte 4byte
    long 4byte 4byte 8byte
    unsigned long 4byte 4byte 8byte
    long long 8byte 8byte 8byte
     
  • 相关阅读:
    011-通过网络协议解析网络请求-DNS-ARP-TCPIP
    010-HTTP协议
    009-DNS域名解析系统
    008-ICMP协议(网络控制文协议)
    007-IP报文协议
    007-排序算法-堆排序
    006-排序算法-希尔排序
    007-Linux 查看端口
    005-排序算法-归并排序
    004-排序算法-选择排序
  • 原文地址:https://www.cnblogs.com/xsyl/p/6055339.html
Copyright © 2011-2022 走看看