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

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.

主站蜘蛛池模板: 昭平县| 阿拉善左旗| 改则县| 偃师市| 蒲城县| 古交市| 乐亭县| 鸡东县| 客服| 吉林市| 临桂县| 武鸣县| 东阿县| 张掖市| 蕲春县| 若尔盖县| 兴宁市| 贵溪市| 垣曲县| 五原县| 辛集市| 泸州市| 米易县| 龙井市| 山阳县| 凌云县| 株洲市| 灵丘县| 阿拉善左旗| 柘荣县| 吉木萨尔县| 长沙市| 称多县| 扎赉特旗| 鄂州市| 射洪县| 弋阳县| 武隆县| 江门市| 凤凰县| 石阡县|