- 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]
推薦閱讀
- 走進(jìn)奇妙的數(shù)學(xué)世界(小學(xué)一二年級(jí))
- 數(shù)學(xué)不簡(jiǎn)單:從《最強(qiáng)大腦》發(fā)現(xiàn)思維樂趣
- 奇妙數(shù)學(xué)史:數(shù)字與生活
- 瘋狂的數(shù)學(xué)游戲
- 好玩的數(shù)學(xué)符號(hào)
- Blockchain Quick Reference
- Hands-On Blockchain with Hyperledger
- Blockchain for Decision Makers
- 跟愛因斯坦一起玩數(shù)學(xué)(進(jìn)階篇)
- 趣味魔方:一學(xué)就會(huì)的魔方秘笈
- Hyperledger Cookbook
- 圖解數(shù)學(xué)思維訓(xùn)練課:建立孩子的數(shù)學(xué)模型思維(多步計(jì)算應(yīng)用訓(xùn)練課)
- 經(jīng)濟(jì)數(shù)學(xué)(二):線性代數(shù)、概率論及數(shù)理統(tǒng)計(jì)
- 心中有數(shù):生活中的數(shù)學(xué)思維
- 別萊利曼的趣味幾何學(xué)