布尔型
一个布尔类型的值只有两种:true和false
字符
golang中没有专门的字符类型,一般使用byte或rune来保存单个字符
其中byte是int8的别名,rune是int32的别名
byte一般用来保存ascii码以内的,rune用来保存unicode码,涉及到中文的全部使用rune来表示,因为一个中文字符可能是由多个字节组成的,byte表示不了
一个布尔类型的值只有两种:true和false
golang中没有专门的字符类型,一般使用byte或rune来保存单个字符
其中byte是int8的别名,rune是int32的别名
byte一般用来保存ascii码以内的,rune用来保存unicode码,涉及到中文的全部使用rune来表示,因为一个中文字符可能是由多个字节组成的,byte表示不了
上一篇:golang基础数据类型-字符串
基本使用(1)只允许取值true或者false(2)bool 类型占据1个字节(3)适用于逻
Go by Example 数据类型
在go语言中,数据类型用于声明函数和变量数据类型的出现是为了把数据分成所需包括。
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M