- Mastering Ethereum
- Merunas Grincalaitis
- 112字
- 2021-06-24 15:01:05
Arrays
Arrays allow you to store large amounts of the same type of variable in one place. They are used as lists that contain a specific type of information for your smart contracts so that you can store your data in an orderly manner. They can be accessed with a simple for loop by getting the length of them.
You can create arrays of uints, strings, structs, addresses, and pretty much any other type:
uint256[] public myNumbers;
string[] public myTexts;
You can also delete elements from an array with the following keyword:
delete myTexts[2];
You can also use .push() and .pop() to add or remove elements from the array in dynamically-sized arrays.
推薦閱讀
- 尖叫的數(shù)學:令人驚嘆的數(shù)學之美
- 這才是好看的數(shù)學
- 數(shù)學也可以這樣學:自然、空間和時間里的數(shù)學
- 數(shù)學的雨傘下:理解世界的樂趣
- 數(shù)字乾坤
- Mastering Ethereum
- 高等數(shù)學(上冊)
- 排序問題的數(shù)學規(guī)劃松弛方法
- Hands-On IoT Solutions with Blockchain
- 迷人的數(shù)學(全2冊)
- 數(shù)學要素(全彩圖解 + 微課 + Python編程)
- 自然哲學的數(shù)學原理(漢譯世界學術名著叢書)
- 迷人的數(shù)學+美麗的數(shù)學(共2冊)
- 第四屆(2018)北京高校數(shù)學微課程教學設計競賽優(yōu)秀作品與教改論文集錦
- 午餐時間聊數(shù)學