位(bit)、字节(byte)、字符(char)、字符串(string)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cui6864520fei000/article/details/89067565

1.位

数据存储的最小单位。

每个二进制数字0或者1就是1个位

2.字节

8个位构成1个字节

1 byte=8bit

1KB=1024B

1MB=1024KB

1GB=1024MB

3.字符

a、A、中、+、*、,、等均表示一个字符 使用' '

一般utf-8编码下, 一个汉字字符占用3个字节

一般gbk编码下,一个汉字字符占用2个字节

4.字符串 使用" "

即各种各个字符的集合

猜你喜欢

转载自blog.csdn.net/cui6864520fei000/article/details/89067565