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

  • 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]
主站蜘蛛池模板: 鄂州市| 资源县| 会东县| 彝良县| 淮北市| 观塘区| 河池市| 鹤岗市| 察雅县| 长宁区| 剑阁县| 深泽县| 荥阳市| 保靖县| 丁青县| 富裕县| 建瓯市| 龙南县| 乐安县| 延寿县| 广昌县| 石台县| 桦川县| 长治县| 阳城县| 特克斯县| 景宁| 东光县| 肃北| 南充市| 乳山市| 胶南市| 泾川县| 广东省| 邯郸市| 哈密市| 新郑市| 麻栗坡县| 临清市| 日喀则市| 龙南县|