Objective-c主要分为四种基本数据类型:

整型:short int (内存中占16位);    2个字节(Mac中) 2个字节(ios)

         int(内存中占32位);             4 个字节(Mac中)4个字节(ios)

         long int(内存中占64位);      8个字节(Mac中) 4个字节(ios)

         long long(内存中占64位);   8个字节(Mac中) 8个字节(ios)

字符型:(0--255) 8位无符号整数 1个字节(不支持中文)

浮点型:float :4个字节

           double:8个字节

           long double:16个字节

枚举型:

enum season{spring,summer,fall,winter};

BOOL:yes(1)和no(0)

类型转换:

1.所有的short char 都将提升到int型

2.short - int - long - long long - float -double - long doube (低 ->高)

相关文章:

  • 2021-11-25
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
猜你喜欢
  • 2022-01-23
  • 2021-09-19
  • 2021-11-13
  • 2021-10-27
  • 2022-12-23
  • 2021-05-13
相关资源
相似解决方案