官术网_书友最值得收藏!

Array

Arrays are made up of sequenced elements of a specific type. An array can be created for any data type. The length of an array cannot be changed and must be specified at the time of declaration. Arrays are seldom used directly, but are used mostly through the slice type covered in the next section. Arrays are always one-dimensional, but you can create an array of arrays to create multidimensional objects.

To create an array of 128 bytes, this syntax can be used:

var myByteArray [128]byte  

Individual elements of an array can be accessed by its 0-based numeric index. For example, to get the fifth element from the byte array, the syntax is as follows:

singleByte := myByteArray[4]
主站蜘蛛池模板: 白河县| 无棣县| 维西| 兴业县| 青冈县| 长垣县| 新密市| 黎川县| 湄潭县| 兴海县| 静乐县| 中山市| 延长县| 静宁县| 澄江县| 梁河县| 博野县| 新竹县| 岐山县| 揭阳市| 东山县| 曲麻莱县| 五峰| 历史| 汕头市| 蛟河市| 和静县| 宜宾县| 葫芦岛市| 武定县| 汶上县| 苗栗市| 灯塔市| 重庆市| 如东县| 凤庆县| 十堰市| 丹凤县| 天津市| 涡阳县| 和平县|