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

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]
主站蜘蛛池模板: 柏乡县| 平遥县| 巍山| 临朐县| 临沭县| 获嘉县| 红原县| 武鸣县| 山东省| 邵东县| 休宁县| 泽州县| 二手房| 莎车县| 罗江县| 越西县| 永修县| 张北县| 梁河县| 巴彦县| 咸阳市| 开平市| 商洛市| 金溪县| 久治县| 孝义市| 澄迈县| 新乐市| 榆林市| 呼伦贝尔市| 台北市| 内江市| 乐至县| 威宁| 绍兴县| 北碚区| 筠连县| 潮州市| 镇坪县| 察隅县| 黎川县|