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

  • Security with Go
  • John Daniel Leon
  • 119字
  • 2021-06-30 19:06:47

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]
主站蜘蛛池模板: 平武县| 泰兴市| 桂林市| 榕江县| 巴青县| 连城县| 榕江县| 泗水县| 舟山市| 古浪县| 龙山县| 瑞安市| 察隅县| 扶沟县| 怀来县| 安陆市| 特克斯县| 阆中市| 都昌县| 册亨县| 睢宁县| 繁峙县| 肥城市| 晴隆县| 葵青区| 桐城市| 梓潼县| 巧家县| 长宁区| 永川市| 岚皋县| 大名县| 万载县| 资中县| 仁化县| 宜阳县| 娱乐| 深泽县| 将乐县| 大安市| 大厂|