C数据类型之基本类型
2014-08-14 10:19
99 查看
先来张C数据类型的图片,如下图
基本数据类型的长度,数据存储是以"字节"(Byte)为单位,数据传输是以"位"(bit)为单位,一位就代表一个0或1(二进制),一个字节(Byte)占8位(bit).
基本数据类型的长度,数据存储是以"字节"(Byte)为单位,数据传输是以"位"(bit)为单位,一位就代表一个0或1(二进制),一个字节(Byte)占8位(bit).
#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { short int shortIntType = 1; int intType = 2; long longType = 3L; float floatType = 4.1f; double doubleType = 5; char charType = 'A'; printf("size of short it is %lu Byte\n",sizeof(shortIntType)); printf("size of int is %lu Byte\n",sizeof(intType)); printf("size of long is %lu Byte\n",sizeof(longType)); printf("size of float is %lu Byte\n",sizeof(floatType)); printf("size of double is %lu Byte\n",sizeof(doubleType)); printf("size of char is %lu Byte\n",sizeof(charType)); } return 0; }输出结果如下图:
相关文章推荐
- C#基本数据类型
- windows api中定义的基本数据类型简介
- Java基本数据类型转换(转)
- Oracle基本数据类型存储格式浅析
- Dev-C++下基本数据类型学习小结
- VB.Net学习笔记(面向对象的基本数据类型)
- Windows基本的数据类型
- SQL的基本操作(1.数据类型)
- C语言基础知识总结(1)-基本数据类型
- java学习笔记(二) ----基本数据类型应用
- Oracle基本数据类型
- Java的基本数据类型与流 (ZT)
- Dev-C++下基本数据类型学习小结
- Java的基本数据类型与流
- 读书笔记:Java基本数据类型的强制转换
- Oracle基本数据类型存储格式浅析(一)——字符类型
- Java中基本数据类型与流的操作方法
- Java基础小知识——基本数据类型和字符串以及字节数组的转换
- Oracle基本数据类型存储格式浅析(一)—(五)
- java学习笔记(十一)基本数据类型的对象包装类